Viewing FSMO with Powershell
Get-ADDomainController -Filter * | ForEach-Object {$_.Name; $_.OperationMasterRoles; Write-Host}
Transfering FSMO roles with Powershell
Move-ADDirectoryServerOperationMasterRole -Identity servername -OperationMasterRole InfrastructureMaster, RIDMaster, DomainNamingMaster, PDCEmulator, SchemaMaster
Showing posts with label Active Directory. Show all posts
Showing posts with label Active Directory. Show all posts
Wednesday, November 2, 2016
Thursday, May 19, 2016
Powershell Moving and Viewing FSMO roles
Recently wanted to move my FSMO roles, but didn't want to use the old method of netdom. Besides, everything is going powershell so might as well start learning now!
View the current holders:
https://blogs.technet.microsoft.com/heyscriptingguy/2014/11/28/powertip-use-powershell-to-get-list-of-fsmo-role-holders/
Now we can move them
http://thelazyadmin.com/2013/08/managing-fsmo-roles-with-powershell/
View the current holders:
- Thanks to The Scripting Guy - Get-ADDomainController -filter * | Select-Object Name, OperationMasterRoles
https://blogs.technet.microsoft.com/heyscriptingguy/2014/11/28/powertip-use-powershell-to-get-list-of-fsmo-role-holders/
Now we can move them
- Move-ADDirectoryServerOperationMasterRole -Identity "servername" -OperationMasterRole 0,1,2,3,4 (or use their names)
http://thelazyadmin.com/2013/08/managing-fsmo-roles-with-powershell/
Wednesday, April 27, 2016
Domain Controller high CPU - Service Host / Security Log
I had been having problems for sometime with our Windows Server 2012 and 2012 R2 domain controllers. The CPU would spike to 50% and sit there occasionally dropping down to 2% and then shortly after back up to 50%.
The process in question was the Service Host: Local Service (Network Restricted).
The sub processes are:
The process in question was the Service Host: Local Service (Network Restricted).
The sub processes are:
- TCP/IP NetBIOS Helper
- Windows Event Log
- DHCP Client
It doesn't take a lot of google fu to find the following post:
https://www.experts-exchange.com/questions/28440274/Why-does-security-logging-on-the-DC-eat-all-the-CPU.html
From this post it indicates that the Windows Security log could be at fault. I took a look at ours and it was set to overwrite and had a maximum size of 1GB (actually well under the MS maximum size, but still large imo). A quick test of clearing the log fixed the issue.
Of course the issue started up again a few days later when the log got full and started to overwrite again. So, I reduced the maximum size of the security log to 10mb (not large enough to hold much of course, but we're just testing at this point). Once the log started overwriting again no issue. From this I made the conclusion that the issue isn't just overwriting events, but rather overwriting the events when the log is very large.
Solution:
- Ensured that our SIEM solution was collecting the logs every hour.
- Set the maximum log size for the security log to a value that will hold 12 hours of logs and then overwrite. To determine this value I just had to wait and then check it's properties (for each DC!)
- If any logging event success / failures are ever changed I'll need to re-evaluate that the size is still sufficient.
Another solution that I didn't like as much was to throw hardware at the issue, ie add a CPU.
In addition here's a good table of MS recommendations on logging settings
https://technet.microsoft.com/en-us/library/dn487457.aspx
In addition here's a good table of MS recommendations on logging settings
https://technet.microsoft.com/en-us/library/dn487457.aspx
Tuesday, December 15, 2015
Files not showing up "timely" for some users with DFS-R
Recently we started having a strange issue where users wouldn't be able to see files, but other users could.
The locations in question resided in a share with DFS-R setup. Only one of the folder targets was enabled so all users are looking at the same share. We could even confirm with DFS tab that they where pointed at the same locations, yet User1 couldn't see the file and User2 could see it. Navigating to the exact path of the share would then display that the file did in fact exist. Only the DFS path showed the issue.
No issues being reported with DFS-R or AD (both running Server 2012).
Taking a step back I recalled that we had fairly recently added a new DC to the environment (Windows Server 2012 R2).
After a quick look at DFS Namespaces I realized that the new DC had not been added as a namespace server.
Preliminary reports look promising that the missing namespace server was the cause for this anomaly. Note to self, always add new DC to namespace servers!
The locations in question resided in a share with DFS-R setup. Only one of the folder targets was enabled so all users are looking at the same share. We could even confirm with DFS tab that they where pointed at the same locations, yet User1 couldn't see the file and User2 could see it. Navigating to the exact path of the share would then display that the file did in fact exist. Only the DFS path showed the issue.
No issues being reported with DFS-R or AD (both running Server 2012).
Taking a step back I recalled that we had fairly recently added a new DC to the environment (Windows Server 2012 R2).
After a quick look at DFS Namespaces I realized that the new DC had not been added as a namespace server.
Preliminary reports look promising that the missing namespace server was the cause for this anomaly. Note to self, always add new DC to namespace servers!
Friday, November 21, 2014
Domain Controller High CPU - Service Host
In an earlier post I talked about how XenApp 6.5 sessions would start and then disappear. In the end I had determined this was due to our Domain Controllers having their CPU's pegged out, at least partially due to insufficient RAM.
http://didyourestart.blogspot.com/2014/09/xenapp-65-session-starts-then-disappears.html
Doing this absolutely solved the XenApp issue, but the DC's continued to have high CPU usage. Basically the pattern was that CPU would sit at 50% for 10 - 15 seconds, then drop to 2%, then back to 50% and the pattern continued.
Under processes you could see that the issue was with the Service Host: Local Service which wraps TCP/IP NetBIOS Helper, Windows Event Log, and DHCP Client. Jump over to the Performance tab and click Open Resource Monitor and click the CPU tab.
Here we see three processes using high CPU in my case:
Under Services the primary eye catcher listed:
Next I looked at Eventlog clue. This lead me to two posts online which nailed it.
Jump into the Eventvwr and look at security log and sure enough it's full. Clear events and instantly the issue resolves... Jump over to the other DC with same issue and clear security log with same result.
Appears that this occurs when the log is full and set to overwrite. I'm still researching if this is caused by some service doing excessive logging which I highly suspect.
http://didyourestart.blogspot.com/2014/09/xenapp-65-session-starts-then-disappears.html
Doing this absolutely solved the XenApp issue, but the DC's continued to have high CPU usage. Basically the pattern was that CPU would sit at 50% for 10 - 15 seconds, then drop to 2%, then back to 50% and the pattern continued.
Under processes you could see that the issue was with the Service Host: Local Service which wraps TCP/IP NetBIOS Helper, Windows Event Log, and DHCP Client. Jump over to the Performance tab and click Open Resource Monitor and click the CPU tab.
Here we see three processes using high CPU in my case:
- svchost.exe
- WmiPrvSE.exe
- perfmon.exe
- EventLog
Next I looked at Eventlog clue. This lead me to two posts online which nailed it.
- http://serverfault.com/questions/591405/peaky-cpu-usage-on-domain-controllers
- http://www.experts-exchange.com/Software/System_Utilities/Q_28440274.html
Jump into the Eventvwr and look at security log and sure enough it's full. Clear events and instantly the issue resolves... Jump over to the other DC with same issue and clear security log with same result.
Appears that this occurs when the log is full and set to overwrite. I'm still researching if this is caused by some service doing excessive logging which I highly suspect.
Monday, January 6, 2014
NETLogon not replicating - Replication service stopped replication on volume C
After a dirty shutdown of a Windows Server 2012 DC I found that my NETLogon was no longer replicating
Event log had event ID 2213 listed under DFS Replication:
The DFS Replication service stopped replication on volume C:. This occurs when a DFSR JET database is not shut down cleanly and Auto Recovery is disabled. To resolve this issue, back up the files in the affected replicated folders, and then use the ResumeReplication WMI method to resume replication.
Additional Information:
Volume: C:
GUID: guidofvolume
Recovery Steps
1. Back up the files in all replicated folders on the volume. Failure to do so may result in data loss due to unexpected conflict resolution during the recovery of the replicated folders.
2. To resume the replication for this volume, use the WMI method ResumeReplication of the DfsrVolumeConfig class. For example, from an elevated command prompt, type the following command:
wmic /namespace:\\root\microsoftdfs path dfsrVolumeConfig where volumeGuid="GUIDofvolume" call ResumeReplication
In Server 2012 the default behavior has changed to a manual recovery from dirty shutdown.
http://blogs.technet.com/b/filecab/archive/2012/07/23/understanding-dfsr-dirty-unexpected-shutdown-recovery.aspx
In my case just executing the wmic command resolved.
wmic /namespace:\\root\microsoftdfs path dfsrVolumeConfig where volumeGuid="GUIDofvolume" call ResumeReplication
At that point you can either start monitoring your eventvwr on your DC :) or set this back to autorecovery
wmic /namespace:\\root\microsoftdfs path dfsrmachineconfig set StopReplicationOnAutoRecovery=FALSE
Event log had event ID 2213 listed under DFS Replication:
The DFS Replication service stopped replication on volume C:. This occurs when a DFSR JET database is not shut down cleanly and Auto Recovery is disabled. To resolve this issue, back up the files in the affected replicated folders, and then use the ResumeReplication WMI method to resume replication.
Additional Information:
Volume: C:
GUID: guidofvolume
Recovery Steps
1. Back up the files in all replicated folders on the volume. Failure to do so may result in data loss due to unexpected conflict resolution during the recovery of the replicated folders.
2. To resume the replication for this volume, use the WMI method ResumeReplication of the DfsrVolumeConfig class. For example, from an elevated command prompt, type the following command:
wmic /namespace:\\root\microsoftdfs path dfsrVolumeConfig where volumeGuid="GUIDofvolume" call ResumeReplication
In Server 2012 the default behavior has changed to a manual recovery from dirty shutdown.
http://blogs.technet.com/b/filecab/archive/2012/07/23/understanding-dfsr-dirty-unexpected-shutdown-recovery.aspx
In my case just executing the wmic command resolved.
wmic /namespace:\\root\microsoftdfs path dfsrVolumeConfig where volumeGuid="GUIDofvolume" call ResumeReplication
At that point you can either start monitoring your eventvwr on your DC :) or set this back to autorecovery
wmic /namespace:\\root\microsoftdfs path dfsrmachineconfig set StopReplicationOnAutoRecovery=FALSE
Subscribe to:
Posts (Atom)