virtualcenter


Our IT journal

Change Active Directory users country code via PowerShell

In order to have correct information in Office 365 when using Azure AD, your users need to have a country code in Active Directory, specially when configuring self-service password reset: $Users = Get-ADUser -Filter {samaccountname -like “*”} foreach ($User in $Users) { Set-ADUser -Identity $User -Country “US” } Get-ADUser -Filter {countrycode -eq 0} | Set-ADUser -Replace @{countrycode=1}  


Configuring an Edge Router for L2TP IPSec VPN using AD authentication via Radius

set vpn l2tp remote-access ipsec-settings authentication mode pre-shared-secret set vpn l2tp remote-access ipsec-settings authentication pre-shared-secret <yourpresharedkey> set vpn l2tp remote-access authentication radius-server 192.168.0.5 key 82LButmnybLpXr%gqOEyj@@7Tu%IjqIdSUpq set vpn l2tp remote-access authentication radius-server 192.168.0.5 port 1812 set vpn l2tp remote-access authentication mode radius set vpn l2tp remote-access client-ip-pool start 192.168.100.200 set vpn l2tp remote-access client-ip-pool stop 192.168.100.249 set vpn l2tp remote-access dns-servers … Read More


Powershell mass update UPN in AD

Import-Module ActiveDirectory $oldSuffix = “myolddomain.local” $newSuffix = “mynewdomain.com” $ou = “DC=yourdomain,DC=local” $server = “Hostname” Get-ADUser -SearchBase $ou -filter * | ForEach-Object { $newUpn = $_.UserPrincipalName.Replace($oldSuffix,$newSuffix) $_ | Set-ADUser -server $server -UserPrincipalName $newUpn }  


Install the vSphere client on a Domain Controller

Sometimes, we may be in the need of installing the vSphere Client on a domain controller. You may have received a “vSphere Client cannot be installed on a Domain Controller” error by the installer. To be able to do this, you just need to open up an administrator command prompt and type the following in the same folder than the … Read More


Retrieving Active Directory user properties via PowerShell

This is all done via Get-ADUser help Get-ADUser   Get-ADUser -identity username -properties *   get-aduser -filter * -properties passwordlastset, passwordneverexpires |ft Name, passwordlastset, Passwordneverexpires With that in mind, lets see a script that exports all data to a CSV while also sorting the objects by Name:   Get-ADUser -filter * -properties passwordlastset, passwordneverexpires | sort-object name | select-object Name, … Read More