Here is my script to create new users and mailboxes from a csv file containing FirstName,LastName,Alias,Displayname,Password.
Other account properties such as homefolder, group membership, roaming profile etc were set with ADmodify.net.
Homefolders were created and shared with a script.
Save the following as import.ps1 and call from powershell.
## My Import Script 01/09/2008
## Section 1
## Define Database for new mailboxes
$db="exchangeserver\database"
## Define User Principal name
$upndom="mydomain.local"
## Define OU for new users
$ou="mydomain.LOCAL/ou/ou etc"
## Define CSV File with user information
$csvFile="my csv.csv"
## Section 2
## Import csv file into variable $users
$users = import-csv $csvFile
## Section 3
## Function to convert Password string to secure string
function SecurePassword([string]$plainPassword)
{
$secPassword = new-object System.Security.SecureString
Foreach($char in $plainPassword.ToCharArray())
{
$secPassword.AppendChar($char)
}
$secPassword
}
## Section 4
## Create new mailboxes and users
foreach ($i in $users)
{
$sp = SecurePassword $i.password
$upn = $i.Alias + "@" + $upndom
$display = $i.Displayname
New-Mailbox -Password $sp -Database $db -UserPrincipalName $upn -Name $i.Alias -FirstName $i.Firstname -LastName $i.Lastname -SamAccountName $i.alias -DisplayName $display -Alias $i.Alias -OrganizationalUnit $OU
}
Wednesday, September 10, 2008
Can't print from Powerpoint!!!!
Having installed new HP PCL 5 drivers (over Jetdirect tcp ports) and shared the printers from a server i was able to print a testpage from clients, also word documents but not powerpoint.
The answer was to change the defaults in the "Print Processor" within the driver settings.
Initially it was set to "HPCPP5r1" with "NT EMF 1.007" data type changing it to "Winprint" and "Raw" solved all problems
The answer was to change the defaults in the "Print Processor" within the driver settings.
Initially it was set to "HPCPP5r1" with "NT EMF 1.007" data type changing it to "Winprint" and "Raw" solved all problems
Subscribe to:
Comments (Atom)
