Posts

Command ipconfig /registerdns, failed and returned error: Registration of DNS records failed: not enough storage is available to complete this operation.

Image
Error Scenario: Command ipconfig /registerdns, it was failed and returned error: Registration of DNS records failed: not enough storage is available to complete this operation. However, it seems that we have enough memory Cause: Dynamic Update was enabled in the server Solution : Disabled Dynamic Update from server registry. registry for **HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters** If the value of DisableDynamicUpdate = 1, change it to 0 and reboot your machine.

Active Directory Replication Error 1722: The RPC server is unavailable

Error message: 1. CALLBACK MESSAGE: Error contacting server 20547b77-7bc2-486a-2cfb-9638a89d99dbd._ msdcs.xxx.com (network error): 5 (0x5):     Access is denied. 2. SyncAll exited with fatal Win32 error: 8440 (0x20f8): The naming context specified for this replication operation is invalid. 3. The RPC server is unavailable. 0x800706ba (WIN32: 1722 RPC_S_SERVER_UNAVAILABLE) Scenario:   Repadmin Syncall command gives one of the above error  Replication doesn't work properly. Cause: Such errors mostly encountered if a DC was renamed, rebuilt, re-promoted with same name and IP. Solution: GUID entry for the old server was mapped with Domain Controller CNAME entry in DNS records. Replace the GUID of new server with Old in CNAME record (Find the GUID from Site & Services> Server name> NTDS Properties) Use Elevated CMD in case of Access Denied

the term ‘connect-msolservice’ is not recognized as the name of a cmdlet function

  Step-1 : Open Windows PowerShell in administrator mode. Then run the following commands serially. If you have installed already  AzureAD PowerShell commands , then run the below command to uninstall. uninstall-module AzureAD Step-2: Then run the below commands one by one. install-module AzureAD install-module AzureADPreview install-module MSOnline Step-3: Then you can run the below command to connect to Azure from Powershell. Import-Module MSOnline $credentials = Get-Credential Connect-MsolService -Credential $credentials

Create bulk test user accounts in active directory using PowerShell

 C opy paste the below code into a PowerShell window in your test lab and change –Path parameter to match your OU structure where you want to place the accounts and execute the script. You will see test accounts with in a minute. Please note this above code is for lab purpose only where you want 100 or 1000 dummy user accounts for testing purpose. If you want to create users in production environment, you might want to set the required attribute values accordingly (like display name, telephone, etc). Import-Module ActiveDirectory foreach ( $i in 1 ..5 00 ) { $AccountName = "TestUser{0}" -f $i $Password = Convertto-secureString -string "testme123" -AsPlainText -force New-ADUser -Name $AccountName -AccountPassword $Password -Path "OU=Labaccounts,DC=ad,DC=live,DC=com" -Enabled: $true }

Correct Way to Rename an Active Directory Domain Controller

If you rename your DC by renaming a Domain Controller in the normal way you would rename a computer (using the System > Rename this PC gui), you didn’t do it right and your metadata is likely irreversibly damaged. However, I have seen success in this situation when multiple DC’s exist by demoting a re-promoting the DC. If only a single DC exists I would say its maybe a good idea to follow the below guide as it may get your out of the proverbial but probably not recommended and you may have to rely on backups.  Use the below method carefully to rename your DC in a right way and for a smooth migration Step 1: Getting ready. Open a command prompt. (Windows key+r (run) + cmd) Step 2: Adding an alternate computer name. SYNTAX : netdom computername <currentDC FQDN> / add:<newDCName FQDN> In the command prompt, type (minus quotes) “netdom computername wrongname.domain.local /add:server.domain.local“   This should return with “Added (NAME) as an alternate nam

Add User To The Local Administrators Group On Multiple Computers Using PowerShell

  To achieve the objective I’m using the Invoke-Command PowerShell cmdlet which allows us to run PowerShell commands to local or remote computers. In the example below, I’ll add my User ABC to the local Administrators group on two Server (serv1, serv2) Invoke-Command -ComputerName Serv1, Serv2 -ScriptBlock {add-LocalGroupMember -Group "Remote Desktop Users" -Member ABC }   There is another everyone's favorite way here along with input file and result comment: $Computerlist = get-content "C:\temp\servers.txt" foreach ($computername in $computerlist) { Invoke-Command -ComputerName $computername -ScriptBlock {add-LocalGroupMember -Group "Administrators" -Member GIN } Write-host "ABC User added in $computername" }