Register
: :
Login
Home
News
Forums
Scripts
User Groups
Resources
About
Forums
Search
Members
Unanswered
Active Topics
Forums
>
Using PowerShell
>
Active Directory
Matching Space
Last Post 21 Jan 2010 02:46 AM by
James
. 5 Replies.
Sort:
Oldest First
Most Recent First
Prev
Next
You are not authorized to post a reply.
Author
Messages
James
Basic Member
Posts:374
18 Jan 2010 01:45 AM
Hello,
I have the following:
$user = Get-QADUser 'Username - morehere"
$user.targetAddress -match "\s"
It returns false...
However the target address is:
smtp:username - morehere@remainderaddresshere.com
Does anyone understand why this is happening?
Many Thanks
James
seaJhawk
Basic Member
Posts:191
18 Jan 2010 09:00 AM
Hi James,
What do you get for $user.targetAddress?
-Chris
James
Basic Member
Posts:374
19 Jan 2010 12:34 AM
Hello,
I have done a write-Host $user.targetaddress if thats what you mean.
It returns a blank line. However the attribute is set and I can see it.
Many Thanks
James
cameronove
Basic Member
Posts:332
19 Jan 2010 05:33 AM
James,
Well it looks like your targetAddress attribute doesn't contain any data. When you say the attribute is set and you can see it; what are you referring to? Are you looking at the attribute via ADUC or ADSI? In other words, what application are you using that shows that the targetAddress attribute has data?
Additionally, what Exchange system are you using. targetAddress is only used on mail-enabled user accounts and contacts with Exchange 2003 and typically points to an external email address. As a matter of fact ADUC doesn't even expose the targetAddress attribute with Exchange 2003 mailbox-enabled users; the only way to get to it is via ADSI or programmatically. For normal Exchange 2003 mailbox-enabled user accounts the mail attribute should be used. If you are working with contacts you should use get-qadobject cmdlet.
I can't speak to Exchange 2007 or 2010 as I'm not using them at present so this may be a mute point.
One other point: When I run get-qaduser against my domain:
$me = get-qaduser myusername -includeallproperties -credential $admincreds
then:
$me | get-member
targetAddress is a noteproperty and its definition is
targetAddress = null
I don't think that Quest is using the targetAddress attribute in the get-qaduser cmdlet because they are setting it to null when you run the command.
Maybe one of the Quest guys could shed more light on that.
James
Basic Member
Posts:374
19 Jan 2010 06:57 AM
Hello,
I am using ADUC to see the target address attribute.
Yes thats correct were running exchange 2007 and we are pointing the target address to microsoft for accounts and mail.
Quite possibly.
However I have used the following command:
Set-QADUser -Identity $_.Name -ObjectAttributes @{TargetAddress=$TargetAddress}
To set the target address initially on the entire domain of students and this works fine. The problem comes when I try and remove a space from it or even match a space as the case maybe.
Does this make any sense?
Many Thanks
James
James
Basic Member
Posts:374
21 Jan 2010 02:46 AM
Can anyone assist with this?
Many Thanks
James
You are not authorized to post a reply.
Using PowerShell
--General PowerShell
--Books, Tools, and Videos
--Exchange Server
--Active Directory
--System Center Family
--Non-Microsoft Products
--SharePoint
--SQL Server
--Working with .NET
--Peer Review
--Testing, Testing...
PowerShell Development
--Cmdlet Development
--PSDrive Provider Development
--Hosting the Shell
Looking Ahead
--Using PowerShell v2.0
--Developing for PowerShell v2.0
PowerShellCommunity.org
--Community Announcements and Assistance
--Completely Unrelated
--User Groups
--Community Business
----Suggestion Box
Forums
>
Using PowerShell
>
Active Directory
Active Forums 4.3
Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2