C# is on the glide path from PowerShell. You don't need the Quest cmdlets, you just need get-mailbox and set-mailbox; which are built-in cmdlets for Exchange.
Regards, Michael B. Smith Consultant and Exchange MVP http://TheEssentialExchange.com From: Paul Steele [mailto:paul.ste...@acadiau.ca] Sent: Thursday, May 06, 2010 9:53 PM To: MS-Exchange Admin Issues Subject: RE: Can Powershell do this? Looks similar to C# or VBscript. I'll have to track down the Quest cmdlet stuff and give it a try... From: KenM [mailto:kenmli...@gmail.com] Sent: May-06-10 9:37 PM To: MS-Exchange Admin Issues Subject: Re: Can Powershell do this? I found some things wrong in my last post this is a little better. $users - get-qaduser Foreach ($user in $users){ $sam = $user.samaccountname set-qaduser $sam -UserPrincipalName $...@domain.local<mailto:$...@domain.local> } On Thu, May 6, 2010 at 7:26 PM, KenM <kenmli...@gmail.com<mailto:kenmli...@gmail.com>> wrote: You can do sometihng like this with the quest cmdlts I dont know your environment so this may not work for you and may need a little tweaking if you have over 1000 users in your domain. Can make it more efficient with a LDAP filter looking for users without a UPN. $user = get-qaduser Foreach($user in $users) {set-qaduser $user.samaccountname -Userprincipalname '$user.samaccountn...@domain.local'<mailto:'$user.samaccountn...@domain.local'>} On Thu, May 6, 2010 at 7:06 PM, Paul Steele <paul.ste...@acadiau.ca<mailto:paul.ste...@acadiau.ca>> wrote: As we proceed with our Exchange 2010 migration, I discovered that some mailboxes appear corrupted to powershell users, resulting in this error: [PS] C:\>get-mailbox -identity rmurphy WARNING: The object ad.acadiau.ca/academic/rmurphy<http://ad.acadiau.ca/academic/rmurphy> has been corrupted, and it's in an inconsistent state. The following validation errors happened: WARNING: Property expression "rmurphy" isn't valid. Valid values are: Strings that includes '@', where '@' cannot be the last character After some digging I discovered that the AD account attribute UserPrincipleName does not have a domain associated with it (e.g. 'rmurphy' instead of 'rmur...@domain'). This can be fixed easily in ADUC under the Account tab, but with over 100 users in this state I'd like to find a programmatic way of doing it. I could whip together a C# or VB script to fix the problem, but I was wondering if this sort of thing could be done in PowerShell. I'm still learning PS but from what I've seen I think the answer is yes. Anyone PowerShell experts out there?