
Here are some basic commands to create and manage accounts in bulk.
Account Provisioning
1) AD account creation
1 | New-ADUser -Name "DisplayName" -GivenName "FirstName" -Surname "LastName" -SamAccountName "samaccountname" -UserPrincipalName "logonname@Domain.com" -Path "DN of OU" -AccountPassword(Read-Host -AsSecureString "Input Password") -Enabled $true |
The Read-Host parameter will ask you to input a new password. Note that the password should meet the length, complexity, and history requirements.
The account can be verified by running the following cmdlet:
1 | Get-ADUser -Identity 'user123' -Properties * |
2) mailbox creation
1 | Enable-RemoteMailbox -identity -PrimarySMTPAddress <a href="mailto:firstname.lastname@Domain.com">firstname.lastname@Domain.com</a> -RemoteRoutingAddress <a href="mailto:samaccountname@Domain.mail.onmicrosoft.com">samaccountname@Domain.mail.onmicrosoft.com</a> -alias<br>Set-RemoteMailbox -identity -EmailAddressPolicyEnabled $True |
3) skype f.b. on-prem activation
1 | $creds = (Get-Credential)<br>New-PSSession -ComputerName SFBServer.Domain.com -Credential $creds<br>Enable-CsUser -Identity "iam.test@Domain.com" -RegistrarPool "PoolName.Domain.com" -SipAddressType EmailAddress -SipDomain Domain.com |
4) Teams coexistence mode configuration
(SfB online powershell)
1 | $psCred = Get-StoredCredential -Target "MyCredentialStoreItem" –AsCredentialObject<br>$CSSession = New-CsOnlineSession -Verbose -Credential $psCred -OverrideAdminDomain Domain.onmicrosoft.com<br>Import-PSSession $CSSession -AllowClobber<br>Grant-CsTeamsUpgradePolicy -PolicyName SfBOnly -Identity $User |
Leave a Reply