-
Active Directory replication error
repadmin /showattr gc: /gc /atts:partialattributeset >pas_domain.txt List of all attributes in the PAS. This is useful for determining the current count. Run the following command to export the result to a pas.txt file: repadmin /showattr fsmo_schema: ncobj:schema: /filter:”(ismemberofpartialattributeset=TRUE)” /subtree /atts:dn >pas.txt repadmin /showattr fsmo_schema: ncobj:schema: /filter:”(ismemberofpartialattributeset=TRUE)” /subtree /atts:dn >pas.txt https://learn.microsoft.com/en-us/troubleshoot/windows-server/identity/replication-error-8464 https://mskb.pkisolutions.com/kb/4536765 Event ID: 1450, Event ID: 1203,Event ID: 1791 This problem occurs because the SD on the problem object has exceeded the maximum size of 65,535 bytes. This is an operating system limitation
-
AD Tools
https://learn.microsoft.com/en-us/sysinternals/downloads/adexplorer AD Insight – AD Insight is an LDAP (Light-weight Directory Access Protocol) real-time monitoring tool aimed at troubleshooting Active Directory client applications
-
Active Directory – Phatom Object
-
Powershell – Set ACL for each folder with respective share foldels
This is working fine: $csv = Import-Csv -Path “$env:userprofile\desktop\KDrivePath.csv” ForEach ($item In $csv) { $acl = Get-Acl $item.Path $AddPerm = New-Object System.Security.AccessControl.FileSystemAccessRule($item.Name,”FullControl”,”ContainerInherit, ObjectInherit”, “None”,”Allow”) $acl.SetAccessRule($AddPerm) $acl | Set-Acl $item.Path Write-Host -ForegroundColor Green “Group $($item.Name) created!” }
-
PowerShell – Find Name & OS Version of Domain Controllers
Get-ADDomainController -Filter * | select name, operatingsystem
-
Get nested Active Directory group members
function Get-ADNestedGroupMembers { [cmdletbinding()] param ( [String] $GroupName ) import-module activedirectory $Members = Get-ADGroupMember -Identity $GroupName $members | % { if($_.ObjectClass -eq "group"){ Get-ADNestedGroupMembers -GroupName $_.distinguishedName } else { return $_.distinguishedname } } }
-
User password changed time using PowerShell
Get-QADUser pugazh| select PasswordLastSet To know no. of days since the user changed his password, ((get-date) – (Get-QADUser pamarths).PasswordLastSet).days
-
Create multiple test user accounts
Import-Module ActiveDirectory foreach($i in 1..10) { $AccountName = "TestUser{0}" -f $i $Password = Convertto-secureString -string "password" -AsPlainText New-ADUser -Name $AccountName -AccountPassword $Password -Path "OU=testing,DC=pugazh,DC=in" -Enabled:$true }
-
Powershell: Find Services failed to start after server reboot
[cmdletbinding()] Param( [string[]]$ComputerName = $env:ComputerName ) foreach($Computer in $ComputerName) { if(Test-Connection -Computer $Computer -Count 1 -quiet) { try { $services = Get-WMIObject -Class Win32_Service -Filter "State='Stopped'" -ComputerName $Computer -EA stop foreach($service in $services) { if(!(($service.exitcode -eq 0) -or ($service.exitcode -eq 1077))) { $Error = Invoke-Expression "net helpmsg $($service.Exitcode)" $Service | select Name, Startmode, State, Exitcode,@{Label="Message";Expression={$Error[1]}} } } } catch { Write-Verbose "Failed to query service status. $_" } } else { Write-Verbose "$Computer : OFFLINE" } }
-
Force dns registration on remote computers
([WMIClass]"\\Computer-Name\ROOT\CImv2:Win32_Process").Create("cmd.exe /c ipconfig /registerdns") New-CimSession -ComputerName computer-name | Register-DnsClient