July 2017
Intermediate to advanced
648 pages
31h 9m
English
When running the New-Mailbox cmdlet, the -Password parameter is required, and you need to provide a value for it using a secure string object. As you can see from the code, we've used the ConvertTo-SecureString cmdlet to create a $password variable that stores a specified value as an encrypted string. This $password variable is then assigned to the -Password parameter when running the cmdlet. There's no requirement to first store this object in a variable; we could have done it inline, as shown here:
New-Mailbox -UserPrincipalName dave@testlabs.se `
-Alias dave `
-Database DB1 `
-Name 'Dave Jones' `
-OrganizationalUnit Sales `
-Password (ConvertTo-SecureString -AsPlainText P@ssw0rd -Force) `
-FirstName Dave `
-LastName Jones ...Read now
Unlock full access