Moving Users to different groups when creating Mailboxes
Hi,Thanks to all the help that is available, I've had no trouble putting together a powershell script to create users and mailboxes with data from a .csv. However, the accounts need to have specific distribution group membership. The .csv list the distribution group like this: CN=SBStudentDistribution,OU=DistributionLists,OU=Main,DC=student,DC=banzai,DC=org. In my script I've got the following syntax to attempt to add each user to their necessary distro groups:Code Snip (much of it borrowed from http://www.exchangeninjas.com/BulkCreateMailboxes):$ss = new-securestring $i.password $upn = $i.alias + "@" + $i.fqdn $Identity = $i.Identity new-mailbox -Password $ss -Database $i.database -UserPrincipalName $upn -Name $i.name -OrganizationalUnit $i.ou Add-DistributionGroupMember -Identity $i.Identity -Member $upn } I've researched the syntax but I'm especially dense or something becuase I receive the following error:The term 'Identity' is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try again. At C:\Student_Staff_Import\BulkCreateMailboxes.ps1:24 char:10 + Identity <<<< = $i.Identity + CategoryInfo : ObjectNotFound: (Identity:String) [], CommandNot FoundException + FullyQualifiedErrorId : CommandNotFoundException No matter what syntax I use I seem to receive the same error. Any help would be very much appreciated.Thanks,
February 7th, 2010 11:46am

It' hard to tell exactly from the information provided, but it looks like both of the parameters provided to Add-DistributionGroupMemeber are user identities. I believe the identity parameter needs to be the identity of the group.
Free Windows Admin Tool Kit Click here and download it now
February 7th, 2010 8:11pm

What is $i?Active Directory, 4th Edition - www.briandesmond.com/ad4/
February 8th, 2010 3:53am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics