OpsaC - Operating as PowerShell code
published: March 17, 2015 author: Tinu tags: Active Directory categories: Active Directory
Wenn ein DC promoted wurde, sollte dieser überprüft werden.
Im SYSVOL werden die Policies und Scripts domain-wide abgelegt.
ls (get-wmiobject -class win32_share -computer . | `
where-object {$_.Name -eq 'SYSVOL'}).Path | `
select Name, FullName, Length, LastWriteTime, CreationTime | ft -auto
ntds.dit ist die Active Directory Datenbank
$key = "hklm:\SYSTEM\CurrentControlSet\Services\NTDS\parameters"
ls (Get-ItemProperty $key).'Database log files path' | `
select Name, FullName, Length, LastWriteTime, CreationTime | ft -auto
dcdiag
repadmin /showrepl
repadmin /replsummary
repadmin /syncall
$dc = (read-host 'Enter DC name')
Get-ADReplicationFailure $dc
$dc = (read-host 'Enter DC name')
Get-ADReplicationFailure -scope SITE -target $dc | FT Server, FirstFailureTime, `
FailureClount, LastError, Partner -AUTO
$dc = (read-host 'Enter DC name')
$domainDN = (Get-ADDomain).DistinguishedName
Get-ADReplicationAttributeMetadata -Object "CN=Domain Admins,CN=Users,$($domainDN)" `
-Server $dc -ShowAllLinkedValues | ft
$dc = (read-host 'Enter DC name')
Get-ADReplicationPartnerMetadata -target $dc | Select LastChangeUsn, `
LastReplicationResult, LastReplicationSuccess, Partition, Server,
PartnerType, PartnerAddress | ft -auto
$dc = (read-host 'Enter DC name')
Get-ADReplicationQueueOperation -server $dc
Get-EventLog -list | select Log
$logname = `(read-host 'Enter the Logname')`
Get-EventLog -LogName $logname -Newest 20 | ft -auto