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 }
On Thu, May 6, 2010 at 7:26 PM, KenM <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'} > > > > > > On Thu, May 6, 2010 at 7:06 PM, Paul Steele <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 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? >> >> >> >> >> >