Setup: Microsoft Active Directory DNS Problem: You want to update some DNS records via PowerShell as part of a script, useful for failover situations. Solution: Use the following PowerShell script
Articles Tagged: Active Directory
Reset a Domain Machine Account Password
Setup: A computer member in a domainProblem: “The trust relationship between this workstation and the primary domain failed” Solution:Login with local administrator on the computer and run this command: If you need to run this command on a remote computer try the following script. Important: You need to know the local admin password for that […]
SCCM – System discovery of an untrusted forest fails with 0x8007052E
Setup: You have SCCM 2012 deployed in Forest Alfa but you want to discover machines in forest Beta. Problem: You supply alternative credentials with the correct username and password for forest Beta but kept getting back a error – 0x8007052E – “Logon failure: unknown user name or bad password.” Solution: Use fqdn of Beta forest […]
How to Move Active Directory FSMO roles with PowerShell
Setup: Active directory domain with many domain controllers Problem: You want to move FSMO roles to another domain controller Solution: You can move the Active Directory (AD) from the command prompt using PowerShell in just a few seconds with PowerShell. Make sure you import the Active Directory PowerShell module: Transfer all the FSMO roles at […]
Compare group membership of two users in Powershell
Setup: Member server in Active Directory domain Problem: You need to compare group membership of two users Solution: Run this command in PowerShell The get-hash is a PowerShell hash function . Get-QADUser cmdlet is part of ActiveRoles
Find LastLogon date on a server for all local and domain users
Setup: A Windows server member of a domain or workgroup Problem: You need LastLogon date for all the users who ever logged in on that server. Solution: Open PowerShell console and run this script:
Export users from Active Directory in CSV with PowerShell
Setup: You have access to a domain member computer with Active Roles installed Problem: You want to export users with details from specific OU to a CSV file Solution: Open Powershell Active Roles console and run these commands: -sizelimit 0 will return all users. See http://msdn.microsoft.com/en-us/library/ms180880(v=vs.80).aspx for more details -enabled return only enabled users. Remove […]
Batch Create AD groups from file
Prerequisites: Active Directory, PowerShell, ActiveRoles Management Shell for Active Directory Setup: You have access to a domain member computer in a Active Directory domain Problem: You have a text file with many group names and you want to create them quickly Solution: Open ActiveRoles PowerShell console and run these commands: Tips 1: If you want […]
Manage untrusted domain with Active Directory Users and Computers console
Setup: There is a Active Directory domain and an computer not member in this domain. You try to manage this domain with Active Directory Users and Computers and try to run it with “Run As…”. Problem: You receive this error: The Security database on the server does not have a computer account for this workstation […]
Copy group membership with Powershell
Problem: You have a group in Windows Active Directory and you want to create a new group with same member like the existing one Solution: Prerequisites: member server in Active Directory domain, Quest Powershell tools Tips: – Use Run As to run Powershell under another identity in case your account does not have the right permissions. […]