Powershell: Update computer group membership
without restart! yay! Run line in powershell
Some notes from work
without restart! yay! Run line in powershell
Run this oneliner to get computer free disk space
Microsoft SQL allocate space in database files even if there is no data. To see how much data there is in a database you can query database.
When replacing an domain controller you might need to reuse computer name of the old domain controller. To do that you can create an DNS alias for it. If you for some reason you want to change computer name to the alias you need to run Reboot server for the name change to take effect… Continue Reading Add DNS alias for Domain Controller
After enabling auditing for event 4688, see post about auditing Microsoft AD DS(TBD). You can collect logs to see cmd activity for a user. I have wrote this powershell function little quick to help me out with this. But I do recommend an greylog for this purpose.
After enabling auditing for event 4624, see post about auditing Microsoft AD DS(TBD). You can collect logs to see login activity for a user. I have wrote this powershell function little quick to help me out with this. But I do recommend an greylog for this purpose.
I got a weird case that DCHP settings has disappeared. Scope options and lease times where gone and resett, some routes where gone as well. We did use powershell to find effected scopes and to restore some of the options. The code is not pretty but it does the job for
WMI does store timestamp in CIM_DATETIME format. To convert it to a more readable format there is a .Net management Class to help us out.
if an Certificate Template has enabled Publish certificate in Active directory it will publish the certificate in an attribute on the user object. This usally is not requiered to do and it might cause some problems. To find what account that has certificate published to their user object run following oneliner.
To get most accurat time date for a user last logonyou need to use both lastlogon and lastlogonTimestamp. lastlogon will only be triggered when an interactive logon is done. while lastlogontimestamp will be updated if lastlogon is newer than 14 days(ish) and if an logon is done by a service. You can achieve this with… Continue Reading AD DS: Get last logon for user