Find out if your domain SYSVOL replication is run by FRS or DFS-R


To be sure, run following command on one of your DCs:

dfsrmig /getmigrationstate

If response is “Start” it means you are using FRS
If response is “Eliminated” it means you are using DFS-R

The response indicates the state of FRS to DFS-R migration process. Following states are possible:

0 – “START”
1 – “PREPARED”
2 – “REDIRECTED”
3 – “ELIMINATED”

Windows Server 2008 and later

Advertisements

Troubleshooting Authentication Net Logon Logging


https://blogs.technet.microsoft.com/isablog/2009/06/12/troubleshooting-authentication-issues-in-isa-server-using-net-logon-logging/

Export AD user attributes


csvde -d “dc=dxc,dc=local” -f dxc.csv -s dxc.local -t 389 -r “(&(objectClass=person)(!objectclass=computer))” -l “DN, cn, co, company, department, description, displayName, facsimileTelephoneNumber, givenName, homePhone, l, mail, mobile, objectClass, pager, physicalDeliveryOfficeName, sAMAccountName, sn, streetAddress, title, userAccountControl, userPrincipalName, manager, extensionAttribute1, extensionAttribute2, extensionAttribute3, extensionAttribute8, extensionAttribute12, info, target Address, lastLogonTimestamp, employeeType, accountExpires, Manager”

 

DisconnectSession


Send email using Powershell

CPU,Memory usage


GC C:\server.txt | % {
$Comp = $_
If (Test-Connection $Comp -Quiet){
$Mem = GWMI -Class win32_operatingsystem -computername $COMP
New-Object PSObject -Property @{
Server = $Comp
“CPU usage” = “$((GWMI -ComputerName $COMP win32_processor | Measure-Object -property LoadPercentage -Average).Average) %”
“Memory usage” = “$(“{0:N2}” -f ((($Mem.TotalVisibleMemorySize – $Mem.FreePhysicalMemory)*100)/ $Mem.TotalVisibleMemorySize)) %”
“Total FreeSpace” = “$(“{0:N2}” -f ((Get-WmiObject -Class win32_Volume -ComputerName $COMP -Filter “DriveType = ‘3’” | Measure-Object -property FreeSpace -Sum).Sum /1GB)) GB”
}
}
Else{
“” | Select @{N=”Server”;E={$Comp}},”CPU usage”,”Memory usage”,”Total FreeSpace”
}
}| Select Server,”CPU usage”,”Memory usage”,”Total FreeSpace” |
Export-Csv C:\report.csv -nti

DHCP backup


$hostname = $(Get-WmiObject Win32_Computersystem).name

$date = get-date -f ‘dd-MM-yyyy’

#Deletes backup folder items older than 7 days.

$TargetUNC2 = “\\172.16.196.26\c$\DHCP_Backup\Backup”

Get-ChildItem $TargetUNC2 | where {$_.Lastwritetime -lt (date).adddays(-7)} | Remove-Item remove-item -ErrorAction SilentlyContinue -Confirm:$false

netsh dhcp server backup “C:\DHCP_Backup\Backup\$hostname-$date”

%d bloggers like this: