Archive for the Powershell Category

Depending on the information stored for the users in the AD, there is two ways this can be accomplished: 1.Set email field and default email in ProxyAddresses according to UserPrincipalName: $users = Get-ADUser -Filter * -properties EmailAddress -SearchBase "ou=Test,ou=Departments,dc=DOMAIN,dc=COM" foreach ($user in $users) { $useremail = $user.UserPrincipalName Set-ADUser $user -Add @{'ProxyAddresses' = ("SMTP:"+$useremail )} -EmailAddress $useremail } 2. Set default email in ProxyAddresses Read more [...]

Powershell Commands

| October 24th, 2016

Close all opened sessions

Get-PSSession | Remove-PSSession

Remove all variables from session

Get-Variable -Exclude PWD,*Preference | Remove-Variable -EA 0