July 2017
Intermediate to advanced
648 pages
31h 9m
English
When we ran the New-Mailbox cmdlet in the previous examples, we assigned a secure string object to the -Password parameter using the ConvertTo-SecureString cmdlet. This is a great technique to use when your scripts need complete automation, but you can also allow an operator to enter this information interactively. For example, you might build a script that prompts an operator for a password when creating one or more mailboxes. There are a couple of ways you can do this. First, you can use the Read-Host cmdlet to prompt the user running the script to enter a password:
$pass = Read-Host "Enter Password" -AsSecureString
Once a value has been entered into the shell, your script can assign the $pass variable to the -Password ...
Read now
Unlock full access