how to enable mailbox using powershell
is it possible to enable mailbox by this command? it say that ID cannot be found this command will get input from the txt file and create mailbox the content in text file are logon account id any missing parameters? Get-Content C:\temp\movemailbox.txt | Enable-Mailbox -Database 'ussgmail\STG7\MBDB7'
August 7th, 2012 11:12pm

Get-Content C:\temp\movemailbox.txt | foreach {Enable-Mailbox -Identity $_ -Database 'ussgmail\STG7\MBDB7'} Not sure what your input looks like, but get-content will return an array, and enable-mailbox is expecting a scalar (single value) for an identity. See if it works better if you run it through a foreach [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
Free Windows Admin Tool Kit Click here and download it now
August 7th, 2012 11:27pm

Get-Content C:\temp\movemailbox.txt | foreach {Enable-Mailbox -Identity $_ -Database 'ussgmail\STG7\MBDB7'} Not sure what your input looks like, but get-content will return an array, and enable-mailbox is expecting a scalar (single value) for an identity. See if it works better if you run it through a foreach [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
August 7th, 2012 11:33pm

If you have the CSV file then the CSV file needs headers where the first line should look like this: DisplayName,UserID $Mailboxes = Import-CSV c:\filename.csv ForEach ($Mailbox In $Mailboxes) { New-Mailbox -Name $Mailbox.DisplayName -DisplayName $Mailbox.DisplayName -SamAccountName $Mailbox.UserID } You will have to supply additional fields in the CSV file like the Database, password, etc.
Free Windows Admin Tool Kit Click here and download it now
August 8th, 2012 1:48am

If you have the CSV file then the CSV file needs headers where the first line should look like this: DisplayName,UserID $Mailboxes = Import-CSV c:\filename.csv ForEach ($Mailbox In $Mailboxes) { New-Mailbox -Name $Mailbox.DisplayName -DisplayName $Mailbox.DisplayName -SamAccountName $Mailbox.UserID } You will have to supply additional fields in the CSV file like the Database, password, etc.
August 8th, 2012 1:50am

Please post the exact error message. Ideally, this should work provided the logon account exists.
Free Windows Admin Tool Kit Click here and download it now
August 8th, 2012 4:26am

Please post the exact error message. Ideally, this should work provided the logon account exists.
August 8th, 2012 4:27am

Hi You command looks fine but what do you have in movemailbox.txt? It is best to have a list of SAM account names e.g. user1 user2 user3 ... If you run this command it should return a list of user accounts: Get-Content C:\temp\movemailbox.txt | Get-User Cheers, Steve
Free Windows Admin Tool Kit Click here and download it now
August 8th, 2012 4:44am

Hi You command looks fine but what do you have in movemailbox.txt? It is best to have a list of SAM account names e.g. user1 user2 user3 ... If you run this command it should return a list of user accounts: Get-Content C:\temp\movemailbox.txt | Get-User Cheers, Steve
August 8th, 2012 4:46am

need to add in the domain in front for this command to work as our side have multiple domain example sh\user1 thanks all for the help
Free Windows Admin Tool Kit Click here and download it now
August 12th, 2012 10:39pm

need to add in the domain in front for this command to work as our side have multiple domain example sh\user1 thanks all for the help
August 12th, 2012 10:41pm

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

Other recent topics Other recent topics