Skip to main content

Windows

Documentation related to the operation of Windows OS

Active Directoy

Active Directory Auditing Tool

https://www.manageengine.com/products/active-directory-audit/account-management-events/event-id-4...

Active Directory: Add a Domain Controller to PowerShell

https://247-it.io/en/active-directory-add-a-domain-controller-to-powershell/#:~:text=Domain%20Con...

Add a domain to the Active Directory

https://lazyadmin.nl/it/add-a-domain-to-the-active-directory/ How to add a domain to the Active ...

Add a Mapped Drive to a User Profile Using GPO

Log into the Group Policy Management console Create a new group policy and link it to the OU a...

Add all users in OU to security group

While working on figuring out how to add all of RS domestic to a security group quickly, develope...

Add Extension Attribute to User

Description This article will detail how to add an extension attribute to a user that will...

ADSI Purge

(&(Name=WHCC-01-VSRV03*))  (&(Name=LAFAD01*))                    Clean Up ...

Change Windows Desktop Background Using Group Policy

How to Change Windows Desktop Background Using Group Policy This demonstration is using a Window...

Checking Active Directory Domain Controller Health and Replication

https://woshub.com/check-active-directory-health-and-replication/ How to Check AD Domain Control...

Clean Up Server Metadata

This is the guide to use when a Domain Controller (DC) crashes and cannot be removed from the dom...

CONFIGURE NTP TIME SYNC USING GROUP POLICY

https://theitbros.com/configure-ntp-time-sync-group-policy/#:~:text=Configure%20Client%20Time%20S...

Create a Group to Assign Permissions to Access Files

Best practice is to always create a security group, and assign that security group file permissio...

Create WMI Filters for the GPO

Applies To: Windows Server 2012 To make sure that each GPO associated with a group can only be a...

Cross Forest Resource Security

Cross-forest resource security    To grant access to resources from one forest to another:  ...

Demote or Promote Domain Controller

Both of these commands need to be ran under credentials that have authority to demote the server....

Determine AD forest and domain level

Get-ADDomain | select domainMode, DistinguishedName   Get-ADForest | select forestMode    From...

Disable "These files might be harmful to your computer" warning?

https://superuser.com/questions/149056/disable-these-files-might-be-harmful-to-your-computer-warn...

Disabling and Enabling Outbound Replication

Disabling and Enabling Outbound Replication Last Updated: July 7, 2024 Disabling and En...

Domain Controller DNS Best Practice

It is best practice when using multiple domain controllers with the DNS role to set the servers a...

Domain Trust

Periodically we will get a call where the person cannot log into their computer and they get an e...

Force reinstall of applications deployed by software GPO after uninstall

https://social.technet.microsoft.com/Forums/ie/en-US/82f1e144-78a3-4446-8aaf-18843c890cdc/force-r...

Get Password Info

DSQUERY // ADComputer         Get listing of all accounts with info:  Get-ADUser -filter * -...

How To Add Local Administrators via GPO (Group Policy)

https://thesysadminchannel.com/add-local-administrators-via-gpo-group-policy/ In every organizat...

How to Audit User Account Changes in Active Directory

https://www.lepide.com/how-to/audit-user-account-changes-in-active-directory.html#:~:text=To%20tr...

How to Change the Default Lock Screen Image using GPO

Step-by-step: How to Change the Default Lock Screen Image using GPO This example below will demo...

How to create and manage the Central Store for Group Policy Administrative Templates in Windows

https://learn.microsoft.com/en-us/troubleshoot/windows-client/group-policy/create-and-manage-cent...

How to Disable NTLM Authentication in Windows Domain

https://woshub.com/disable-ntlm-authentication-windows/ The key NTLMv1 problems: weak encrypt...

How to Export Active Directory Users to CSV and Build Reports

https://adamtheautomator.com/export-active-directory-users-to-csv/ For many Active Directory (AD...

How to find the source of failed logon attempts

Step 1: Enable 'Audit Logon Events' policy Open 'Server Manager' on your Windows server ...

How To Fix Group Policy: Error Windows could not determine if the user and computer accounts are in the same forest

If you have an issue where the User Policy doesn’t get updated and gives you an error about the...

How to install and configure Microsoft LAPS

https://4sysops.com/archives/how-to-install-and-configure-microsoft-laps/ Download LAPS LAPS co...

How to Remove (Demote) a Domain Controller in Active Directory

Removing an Active Directory Domain Controller and ADDS Role (Step-by-Step) If you are going to ...

How to Remove (Demote) a Domain Controller in Active Directory

https://woshub.com/remove-domain-controller-active-directory/ Removing an Active Directory Domai...

How to store BitLocker keys in Active Directory

https://coady.tech/store-bitlocker-keys-in-ad/ BitLocker is a fantastic way to protect the d...

Joining Active Directory Error

https://www.truenas.com/community/threads/joining-active-directory-error.97316/ Hi...

Keytab file

A keytab is a file that contains the encrypted password for a user and should allow for joining t...

LAPS_OperationsGuide

  Local Administrator Password Management Detailed Technical Specification   Published: June ...

Migrate user domain profile from one domain to another domain

https://community.spiceworks.com/how_to/145014-migrate-user-domain-profile-from-one-domain-to-ano...

Modify Group Policy's refresh interval

https://www.itprotoday.com/compute-engines/how-can-i-modify-group-policys-refresh-interval A. By...

Move FSMO Roles

Move-ADDirectoryServerOperationMasterRole -Identity CM-01-HVSRV16 -OperationMasterRole Infrastruc...

Move-ADDirectoryServerOperationMasterRole

https://learn.microsoft.com/en-us/powershell/module/activedirectory/move-addirectoryserveroperati...

Netlogon Logging

To enable NetLogon Logging, use the following command on a domain controller:  nltest /dbflag:0x...

Powershell export AD users in OU to CSV

###########################################################  # AUTHOR  : Victor Ashiedu  # WEBS...

Rejoining an "untrusted" workstation and primary domain

Test-ComputerSecureChannel -Repair is all you need to do on the client Reset-ComputerMachinePass...

Rename Domain

Found this article which looks like it is very good    http://www.rebeladmin.com/2015/05/step-b...

repadmin

This command syncs all DC to this one  repadmin /syncall RHSC-00-VSRV18 /d /e     repadmin /sy...

Repairing Broken Trust Relationship Between Workstation and AD Domain

https://woshub.com/repair-trust-relationship-workstation-with-ad-domain/ In this article we’ll s...

Restore Default Domain Policy

Examples  Restore the Default Domain Policy GPO to its original state. You will lose any changes...

Securing Active Directory: Who can add computers to the domain? Only the domain admin?

https://sid-500.com/2017/09/09/securing-active-directory-who-can-add-computers-to-the-domain-only...

Security Groups

https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/manage/understand-security-groups...

Step-By-Step: Manually Removing A Domain Controller Server

https://techcommunity.microsoft.com/t5/itops-talk-blog/step-by-step-manually-removing-a-domain-co...

USER PROFILES AND USER FOLDERS REDIRECTION USING GPO

http://dalaris.com/user-profiles-and-user-folders-redirection-using-gpo/ Assume that you have a ...

Using NTDSUTIL Metada Cleanup to Remove a Failed/Offline Domain Controller Object.

https://chinnychukwudozie.com/2014/01/27/using-ntdsutil-metada-cleanup-to-remove-a-failedoffline-...

Wrong error message for missing .adml files

Symptoms SR symptoms: EN-US Domain Controller tries to create a settings report for a GPO. Th...

Transferring/Seizing FSMO Roles to Another Domain Controller

https://woshub.com/transfer-seize-fsmo-roles-in-active-directory/ Transferring/Seizing FSMO Role...

Raise domain and forest functional levels in Active Directory Domain Services

Raise domain and forest functional levels in Active Directory Domain Services Article 11/01...

Azure Cloud Sync

Originally AD Connect was the way that we synced Active Directory (AD) to Azure/365 (AAD).  That ...

Azure Join Checklist

This document will outline the proper way to join a computer to an Azure domain from a local AD d...

Bypass Bitlocker and Boot into Safemode

This will allow you to bypass bitlocker and boot into safe mode. This will not bypass encryption,...

CMD Line

7zip Command Line

Archive   7za a -tzip C:\Accent\temp2\archive2.zip H:\Downloads\SUU_14.12.200.69.iso -v10m    ...

Add user to Administrators Group

net localgroup administrators [username] /add    From <http://superuser.com/questions/515175/cr...

Choice Command

http://www.techrepublic.com/blog/window-on-windows/make-the-choice-command-work-for-you-even-in-w...

CMD Line Admin

CMD Line as ADMINISTRATOR  runas /user:%computername%\administrator cmd    device manager   s...

CMD Line Registry Delete

September 14, 1999 05:14 PM   How can I delete a registry value/key from the command line?  ...

Configure TCP/IP from the Command Prompt

  Save current settings  netsh -c interface dump > c:'location1.txt  When you reach location #...

DNS Change Via CMD Line

First find the network name by using:  netsh interface show interface    You should see someth...

Enable Remote Desktop Via Command Line

netsh advfirewall firewall set rule group="Network Discovery" new enable=yes    netsh advfirewa...

Hyper-V

netsh firewall set opmode disable    Pasted from <http://www.wantmoore.com/archives/2007/02/20/...

Invalid H:\ Drive

You receive an "Error " error message when you try to install or remove a Microso...

Network Share Folder

net share Docs=E:\Documents /grant:everyone,FULL    From <http://www.windows-commandline.com/li...

Remote GPResult

Cmd line that can be ran remotely.    gpresult /scope computer /v /user FKC\mpeak > %systemdriv...

Run Commands

In case you wanted to get a command line thrill today....    Useful RUN Commands   To Access…. ...

Test if Computer is Azure Joined

dsregcmd /status

Windows Activation Post Azurre Migration

From CMD Prompt slmgr /upk slmgr /cpkyslmgr /ckms slmgr /ckhcslmgr /ipk <License Key>slmgr /ato

Windows S.M.A.R.T Check

Open a command prompt as Admin wmic diskdrive get status

Check Installed Drive Type

wmic diskdrive get model,name,size

Check type of computer

Get-WmiObject -Class Win32_ComputerSystemProduct | Select-Object -ExpandProperty Name This will ...

Change power settings

Powercfg /Change monitor-timeout-ac 60 Powercfg /Change monitor-timeout-dc 0 Powercfg /Change s...

Colt's List of Useful Commands

Server specific Command  Action  diskperf -Y    From <https://www...

Create Certificate from CSR with no template information

If you have a basic Microsoft CA for lab or production purpose you cannot sign a certificate with...

DFS

Enable users to view calendar information of Room mailboxes

Description Show the user and the subject on a resource calendar instead of just busy/free...

Hyper-V

Instructions to Successfully RDP to Windows 11 Azure AD Joined Desktop

Description How to get RDP working on an Azure Joined PC.  Resolution First, m...

LAPS

Office 365

365 Exchange MFA

2FA          Connect-EXOPSSession -UserPrincipalName Accent@bb.summersphc.com  Connect-EXOP...

365 Password Settings

https://admin.microsoft.com/AdminPortal/Home#/Settings/Services/:/Settings/L1/PasswordPolicy     

AD Connect

Provide the password of the AD DS Connector account  Start the Synchronization Service Manag...

Add_SMTP_365_Proxy_Email.ps1

#Variables  $Domain = "accentconsultingservices.mail.onmicrosoft.com"     #Get all users in Ac...

Azure/Office 365 - Convert from ADConnect to Online Only

When you are ready to turn off DirSync, and all exchange mailboxes are in the cloud, the next ste...

Email Cutover to Office 365

This is intended as high level generic overview, nothing more        Prep  Prep MS 365...

Exporting PST from Office 365

The export must be done in IE or Edge!  Initial export Login to Office 365 with the Compa...

Google email in Outlook

How to set up Gmail in Outlook  Gmail is a popular choice for email, and you can get this as par...

Manage who can create Office 365 Groups

https://docs.microsoft.com/en-us/microsoft-365/admin/create-groups/manage-creation-of-groups?view...

Office 365 and scan to email

How to set up a multifunction device or application to send email using Office 365  Exchange Onl...

Office 365 Exchange Hybrid Migration -Decom

NOTE:  This page is for the cleanup of a Hybrid migration.  This is expected to be the phase AFTE...

Office 365 Exchange Migration - Hybrid

qrW@-*5r2$+3BL3Qvm4*lLS0        Review cutover document to see what applies as it is a more c...

Office 365 Exchange Migration Cutover

0bf8fOnsJo05957fE7FBSnzPJEs3RXx0      PREPARATION:  See other document if Exchange Hy...

OneDrive Grant Access

OneDrive Termination      When someone is NLE terminated we may grant a different user access ...

OneDrive Redirection

Baseline settings for stock OneDrive Redirection GPO        Computer Configuration  Po...

OneDrive Sync Issues

If problem is rooted in dual sync accounts  If logged into wrong OneDrive, download all fi...

Outlook Credential Windows Disappears

If a User reports that their Outlook isn't updating and that it needs a password, but the credent...

Password WriteBack

Setup Self Service Password Reset (SSPR)  SSPR  Requires P1 or P2 Microsoft licensi...

PowerShell Add to Global Admin

Today I was working on adding all the new admin accounts we made for a client to the Global Admin...

routable domain

  Real world use.  Updated Remington Seeds from RHSC.local to remingtonseeds.com for alternate d...

SSO

Setting up Microsoft Azure/365 to an existing AD can be eased by implementing SSO between the sys...

SSPR

Self Service Password Reset  Requires P1 or P2 MS Licensing    Azure Active Directory -> Passw...

Troubleshoot Missing Emails

Login to Office365 portal as administrative user.   Click on Admin  Cli...

Powershell

Alias

To get the Alias of a command:    Get-Alias - Definition "yourCommandHere"    Reverse:    G...

Count Users in AD Group

(Get-ADGroup MFA_Users-Properties*).Member.Count    From <https://help.clouduss.com/mfa-knowled...

Crazy Mouse

Add-Type -AssemblyName System.Windows.Forms;Add-Type -AssemblyName System.Drawing;for($d=0;;$d+=....

DSQUERY // ADComputer

Get password info  ITBR Data Gathering Commands  Onboarding Commands          Dsquery comp...

Enable Script Execution

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned    From <https://technet.microsoft.com/librar...

Get Group Members

$GRP = "Wisys"    Get-ADGroupMember -identity $GRP | select name | Export-csv -path C:\Accent\O...

Get Hash of a File

https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/get-filehash?view...

Import Users from CSV to Group Name

Import-csv "filename.csv" | %{ add-adgroupmember "groupname" -member $_.samaccountname }    Fro...

Inactive Computers

$DaysInactive = 365  $time = (Get-Date).Adddays(-($DaysInactive))      Print on Screen:    ...

Modules

Find-Module -Name AzureAd | Install-Module 

Move 1 VHD at a time

TAGS: HyperV Move VM              $vmName = "ACS-00-VSRV45"  $hostName = "CM-05-SAN01"  ...

Move VM

Tags: HyperV VM VHD Compress        This will move all parts of the VM to a central location....

Network

Lookup MAC in ARP with Powershell with exact address - Get-NetNeighbor | ? { $_.LinkLayerAddress ...

Parameters and Variables

To get Powershell variables available hit CTRL + Enter        Then to get paramet...

Powershell AD

import-module grouppolicy  get-command –module grouppolicy      These commands are needed to ...

Powershell AD User Commands

Get-ADUser -SearchBase “OU=Lincoln,OU=RHSC,dc=rhsc,dc=local” -Filter * -Properties DisplayName, E...

Powershell create PC object

dsadd computer "cn=RHSC-33-LT03, OU=Mobile,OU=Workstation,OU=Belle Plaine,OU=RHSC,DC=RHSC,DC=loca...

Powershell Get Volume Cluster Size

Powershell Get Volume Cluster Size  $wql = "SELECT Label, Blocksize, Name FROM Win32_Volume WHER...

Powershell Services

Get a listing of all services that are set to 'Automatic' startup that is currently 'Stopped'  G...

Powershell to purge checkpoints

Get-VMSnapshot -ComputerName "MyHyperVHost" -VMName "VMWithLingeringBackupCheckpoint"    From <...

PowerShell: Get, Modify, Create, and Remove Registry Keys or Parameters

https://woshub.com/how-to-access-and-manage-windows-registry-with-powershell/#:~:text=You%20can%2...

PST Mailbox Import Export

Exchange 2016:  Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn  foreach ($Mailbox...

Public Folders

Remove Public Folders      Get-PublicFolder -Server <server containing the public folder datab...

Remove lingering snapshots

Get-VMSnapshot -ComputerName "MyHyperVHost" -VMName "VMWithLingeringBackupCheckpoint"        ...

Remove old files from folder

Get-ChildItem –Path  “C:\inetpub\logs\LogFiles” –Recurse -file | Where-Object CreationTime –lt (G...

Remove spaces from files and folders

$path = "Set path per location"  Get-ChildItem $path -File -Recurse | Where-Object { $_.Name.Con...

Safe Sender

dsadd computer "cn=RHSC-33-LT03, OU=Mobile,OU=Workstation,OU=Belle Plaine,OU=RHSC,DC=RHSC,DC=loca...

Search all DHCP servers in a domain for a hostname

Get-DhcpServerInDC <#| ?{ $_.DnsName -notmatch "rhsc-01-vsrv04"} #> | % {  $_.DnsName    $Serve...

Search Users

Active Users:    Get-ADUser -Filter "Enabled -eq 'True'" | Select-Object sAMAccountName, name |...

Searching

To search a folder and subfolders for a wildcard word and aggregate to a  single folder. (THIS MO...

Sync AD with AAD

Start-ADSyncSyncCycle -PolicyType Delta 

Increase function count to Max

$maximumfunctioncount = '32768'

Create & Manage DNS Zones and Records with PowerShell

Create & Manage DNS Zones and Records with PowerShell https://woshub.com/create-manage-dns-zones...

Configure Network Settings on Windows with PowerShell: IP Address, DNS, Default Gateway, Static Routes

https://woshub.com/powershell-configure-windows-networking/ Configure Network Settings on Window...

Registry

Resume-HyperV-Replication Powershell Script

import-module Hyper-V  Get-VMReplication | Where-Object {$_.state -eq "Suspended"} | Resume-VMRe...

S.M.A.R.T

Check SMART on hard drive    wmic diskdrive get status    From <https://www.howtogeek.com/134...

Windows Applications

Windows OS

Chkdsk /r replacment

https://www.altaro.com/hyper-v/repairing-corrupt-file-systems-vms-repair-volume/Repairing     C...

Chrome Profile Migration

  Here’s everything you need to do:  On the computer that has the Chrome profiles that yo...

CMD - SYSPREP

%WINDIR%\system32\sysprep\sysprep.exe /generalize /shutdown /oobe /quiet    From <https://docs....

Decrypt EFS-encrypted files without a cert backup

https://tinyapps.org/docs/decrypt-efs-without-cert-backup.html tinyapps.org / docs / Decrypt EFS...

Disable Bing Search

Run Regedit.exe—just hit the Windows key and the R key to launch Run: dialog, type “Regedit,”...

DISM Options

DISM.exe /Online /Cleanup-image /Restorehealth  DISM.exe /Online /Cleanup-Im...

Find Certificate (SSL) by Thumbprint

Open Powershell as admin  Change to the cert directory by using the command:   cd c...

Net USe

To get a cmd line listing of network drives:  Net use      To remove a network drive (f:)  N...

Remove a Domain User Profile from Windows 10

To delete a user profile in Windows 10, do the following.  Press Win + R hotkeys on th...

Remove from Domain

Cmd        netdom remove RHSC-14-HVSRV01 /domain:RHSC.local        POWERSHELL  $cmpter =...

Remove Local Printer

RUNDLL32 printui.dll, PrintUIEntry /dl /n "HP Color LaserJet 2600n (Copy 1)"  RUNDLL32 printui.d...

Remove Network Printers

You can remotely remove the printer from the registry (I assume you have   admin rights on the r...

Remove Profile

If you have a corrupt profile in Windows 10 there are two easy ways to remove it and rebuild it: ...

Repair Windows

There are several ways to repair Windows when corrupt. Running sfc /scannow is a good start. If t...

Reset-ComputerMachinePassword

Reset-ComputerMachinePassword Reference Module: Microsoft.PowerShell.Management ...

Sticky Keys Trick

https://www.thewindowsclub.com/reset-administrator-password-windows-sticky-keys For a general Wi...

Turn off, disable, or uninstall OneDrive

https://support.microsoft.com/en-us/office/turn-off-disable-or-uninstall-onedrive-f32a17ce-3336-4...

Unable to see windows updates

In Gpedit.msc  The settings page visibility was 'not enabled'.  I enabled and set it to 'ShowAll...

Win 10 Image Restore from Network Location

https://answers.microsoft.com/en-us/windows/forum/all/win-10-image-restore-from-network-location/...

Windows 10 update not showing in settings after update

   The solution is to disable blocking of settings visibility.  RUN - gpedit.msc  Change Compu...

Windows Update Issues

Subject  Windows update issues  From  Michael Felker  To ...

Computer Reboot Event Log

12,13,19,41,1001,1074,6005,6009,7045   Filtering a log by these event ID's will show all system...

Windows Server

Active Windows Server EVAL

DISM /Online /Set-Edition:ServerStandard /ProductKey:xxxxx-xxxxx-xxxxxx-xxxxxx /AcceptEula

Creating a File Share

To create a new file share on a Windows Server using Sever Manager. First, Create a Group to A...

DFS Replication

http://blogs.technet.com/b/askds/archive/2009/06/23/recovering-from-unsupported-one-way-replicati...

DFS Size

(Get-ChildItem "D:\DFS Root" -recurse | Sort-Object length -descending | select-object -first 32 ...

DFSR Error 4012

https://support.microsoft.com/en-us/kb/2218556      How to perform an authoritative synchroniz...

Encrypted SMB

SMB security enhancements Article 05/18/2023 15 contributors Feedback In thi...

How to force an authoritative and non-authoritative synchronization for DFSR-replicated SYSVOL (like "D4/D2" for FRS)

*****Important to note: This should only be done by a competent tech that understands the steps t...

How to: Configure Windows Server to query an external NTP Server

https://community.spiceworks.com/how_to/5765-configure-windows-server-to-query-an-external-ntp-se...

Migrate DHCP from one Server to Another

http://www.terminalworks.com/blog/post/2016/03/08/dhcp-server-migration-from-server-2008r2-to-ser...

NTP Server Commands

set server: w32tm /config /manualpeerlist:time.windows.com  

RADIUS

Well, good 'ol Microsoft strikes again.  Jacob (from Wintek) was able to isolate our NPS/RADIUS a...

Windows server 2016 Activation stuck at 10% for over 12 hours

https://social.technet.microsoft.com/Forums/en-US/dfd6273d-2baa-4ca0-b216-28e521327cfb/windows-se...

WMI Filters for GPO

To make sure that each GPO associated with a group can only be applied to computers running the c...

Adding DNS Alias | Replacing File Server

https://www.edwardsd.co.uk/work/2020/04/adding-dns-alias-replacing-file-server/ https://support....

Using Robocopy

robocopy "Source" "Destination" /xo /xj /zb /r:1 /w:1 /e /copy:dat /np /nfl

Microsoft Graph

Force Bitlocker Recovery Screen

manage-bde -forcerecovery C: shutdown -s -t 0 /f This will clear the TPM and force the bitlocke...

How to Enable DNS Query Logging and Parse Log File on Windows Server

https://woshub.com/enable-dns-query-logging-parse-logfile/ How to Enable DNS Query Logging and P...

Microsoft Key Management Service (KMS) Volume Activation FAQs

https://woshub.com/ms-kms-activation-faq/ Microsoft Key Management Service (KMS) Volume Activati...

WSUS