Mastering DsQuery: Fast Domain Controller Auditing

Using the GUI to find specific servers in a large forest can be time-consuming. DsQuery Server provides a lightning-fast way to extract this data directly from the Command Prompt. Whether you need a list of Global Catalogs or want to find the Schema Master, these commands will save you hours of clicking.
1. Locating Domain Controllers in the Forest
To get a quick list of every DC across all domains in your entire forest, you can use the -Forest switch.
- To get the full Distinguished Name (DN):
DsQuery Server -Forest - To get just the Relative Distinguished Name (RDN):
DsQuery Server -o rdn -Forest
2. Targeting a Specific Domain
If you only want to see the controllers within a specific domain, use the -domain switch: DsQuery Server -domain lazyadminblog.com
3. Finding Global Catalog (GC) Servers
Global Catalogs are vital for forest-wide searches. To find which DCs in a specific domain are configured as GCs: DsQuery Server -domain lazyadminblog.com -isgc
4. Finding FSMO Role Holders
Instead of opening multiple MMC snap-ins, you can find the FSMO role holders directly. For example, to find the server holding the Schema Master role for the forest: DsQuery Server -Forest -hasfsmo schema
Note: You can replace
schemawithnaming,pdc,rid, orinfrastructureto find other role holders.
5. Exporting your Results
The most useful way to use DsQuery is to pipe the results into a text file for documentation or further scripting. Use the > operator to save your output: DsQuery Server -Forest > C:\Logs\AllDCs.txt
#ActiveDirectory #DsQuery #SysAdmin #WindowsServer #ITPro #CodingAdmin #ServerAudit #LazyAdmin #TechTips #DataCenter
How to Get Hardware Serial Numbers Remotely (WMIC & PowerShell)

As a SysAdmin, you often need a serial number or UUID for a warranty check or asset tracking. Instead of walking to the user’s desk or remoting into their session, you can pull this data directly from your workstation using these simple commands.
1. Using WMIC (Legacy Command Line)
WMIC is incredibly efficient for quick, one-off queries against remote systems.
To get a remote serial number:
DOS
wmic /node:"RemoteComputerName" bios get serialnumber
To export results to a central text file: If you are auditing multiple machines, use the /append switch to create a running list:
DOS
set myfile=\\Server\Share\Inventory.txtwmic /append:%myfile% /node:"RemoteComputerName" bios get serialnumber
2. Using PowerShell (Modern Method)
PowerShell is the preferred method for modern Windows environments (Windows 10/11 and Server 2016+). It returns objects that are much easier to manipulate.
Standard Command:
PowerShell
Get-WmiObject -ComputerName "RemoteComputerName" -Class Win32_BIOS
The “Lazy” Short Version:
PowerShell
gwmi -comp "RemoteComputerName" -cl win32_bios
3. Bonus Hardware Commands
Sometimes the serial number isn’t enough. Use these WMIC commands to get a deeper look at the hardware specs:
- CPU Details: Get the exact model and clock speeds.
wmic cpu get name, CurrentClockSpeed, MaxClockSpeed - System Product Info: Pull the motherboard name and the system’s unique UUID.
wmic csproduct get name, identifyingnumber, uuid - Full BIOS Audit: Get the BIOS name, version, and serial number in one go.
wmic bios get name, serialnumber, version
Troubleshooting Connectivity
If these commands fail with “Access Denied” or “RPC Server Unavailable,” check the following:
- Admin Rights: Your shell must be running with Domain Admin or local administrator permissions on the target.
- Firewall: Ensure “Windows Management Instrumentation (WMI)” is allowed through the Windows Firewall on the remote machine.
- WMI Service: Ensure the WinMgmt service is running on the target.
#SysAdmin #PowerShell #WMIC #WindowsServer #ITPro #TechTips #InventoryManagement #LazyAdmin #RemoteAdmin #HardwareHack
Installing ADSI Edit on Windows Server 2003

Whether you are performing a schema extension or manually cleaning up metadata after a failed Domain Controller demotion, ADSI Edit is the tool you need. Because it interacts directly with the Active Directory database, it is powerful—and dangerous.
Warning: ADSI Edit does not have “undo” functionality. Always ensure you have a valid System State backup before making manual attribute changes.
Step 1: Locating the Installation Files
On Windows Server 2003, ADSI Edit is not installed by default. It is part of the Windows Support Tools package.
- From the CD: Insert your Windows Server 2003 installation media and navigate to:
[CD-DRIVE]:\SUPPORT\TOOLS\ - Run the Installer: Double-click SUPTOOLS.MSI and follow the installation wizard.
- No CD? You can download the “Windows Server 2003 Service Pack 2 Support Tools” directly from the Microsoft Download Center.
Step 2: Launching the Console
Once the Support Tools are installed, you can launch the editor:
- Go to Start > Run.
- Type
adsiedit.mscand press Enter.
Step 3: Troubleshooting “adsiedit.msc not found”
If you have installed the tools but still receive an error that the file cannot be found, the system likely hasn’t registered the required library (.dll) file properly.
To manually register the DLL:
- Go to Start > Run.
- Type the following command:
regsvr32 adsiedit.dll - You should see a success message stating that the DllRegisterServer succeeded.
What can you do with ADSI Edit?
ADSI Edit allows you to view and edit the three primary partitions of the Active Directory database:
- Domain Partition: Contains the users, groups, and OUs.
- Configuration Partition: Contains forest-wide configuration data (like site topology).
- Schema Partition: Contains the definitions for every object type and attribute in the forest.
#ActiveDirectory #ADSIEdit #WindowsServer #SysAdmin #ITPro #Microsoft #TechSupport #LazyAdmin #ServerManagement #VintageTech #ADTroubleshooting
How to change the thick or thin provisioning of a virtual disk

🟢 Converting Thin to Thick (Inflation)
If your datastore has plenty of space and you need to eliminate the performance “write penalty” of a thin disk, you can Inflate it.
- Preparation: Power off the VM. Ensure there are no snapshots attached to the VM, as inflation only works on the base
.vmdk. - Locate the File: Go to the VM’s Summary tab. Under Resources, right-click the datastore and select Browse Datastore.
- The “Inflate” Action: Open the VM folder and find the
.vmdkfile. Right-click it and select Inflate.- Note: If “Inflate” is greyed out, the VM is likely still powered on or is already thick-provisioned.
- Finalize: Once the task finishes, you may need to Reload the .vmx file to ensure the vSphere UI reflects the new “Thick” status.
🔵 Converting Thick to Thin (Migration)
Converting back to Thin provisioning is slightly more complex because you cannot “deflate” a disk in place. You must move the data to a new location to reclaim the space.
Method A: Migration (Requires two Datastores)
This is the cleanest way to convert a disk using Storage vMotion or an offline migration.
- Power Off the VM (required for standard Migration; not required for Storage vMotion if licensed).
- Migrate: Right-click the VM and select Migrate > Change Datastore.
- Select Format: In the migration wizard, look for the Select Virtual Disk Format dropdown and choose Thin Provision.
- Target: Select a different datastore than the current one. vSphere will copy the blocks, only writing the actual data to the destination, effectively “thinning” the disk.
Method B: Cloning (Single Datastore)
If you only have one datastore, you cannot migrate the VM to itself to change the format.
- Right-click the VM and select Clone.
- During the clone wizard, select your current datastore as the destination.
- In the Disk Format section, select Thin Provision.
- Once complete, delete the old “Thick” VM and keep the new “Thin” one.
⚠️ Important Considerations
- Backups: Always have a fresh backup. Moving or inflating disks is a heavy I/O operation.
- Lazy vs. Eager Zeroed: When inflating to Thick, vSphere usually defaults to “Lazy Zeroed” (space is reserved, but blocks aren’t cleared until written to). For maximum performance (e.g., for Database logs or VSAN), “Eager Zeroed” is preferred.
- Space Check: Before converting from Thin to Thick, ensure your datastore can handle the immediate consumption of the entire disk size.
#VMware #vSphere #Storage #ThinProvisioning #ThickProvisioning #SysAdmin #ITPro #Virtualization #LazyAdmin #CloudStorage #TechTips
How to Enable Remote Logins in a Windows server

🛠️ The Registry Method (Headless Activation)
By default, Windows Server hardens itself by denying Terminal Server (TS) connections. You can flip this switch manually in the Registry Editor.
- Open Registry Editor: Press
Win + R, typeregedit, and hit Enter. - Navigate to the Key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\ - Modify the Value: Locate the fDenyTSConnections DWORD.
- Value = 1: Remote Desktop is Disabled (Default).
- Value = 0: Remote Desktop is Enabled.
💻 The PowerShell Method (The Modern Way)
If you have PowerShell Remoting enabled, you don’t even need to open a GUI. You can push this change with a single line of code:
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -Name "fDenyTSConnections" -Value 0
To verify the change:
Get-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -Name "fDenyTSConnections"
🛡️ Important: Don’t Forget the Firewall!
Enabling the registry setting is only half the battle. If the Windows Firewall is active, it will still block port 3389. You must allow the RDP traffic:
Via PowerShell:
PowerShell
Enable-NetFirewallRule -DisplayGroup "Remote Desktop"
⚠️ Security Checklist
- NLA (Network Level Authentication): For modern security, ensure the value
UserAuthenticationin the same registry path is set to1. This requires users to authenticate before a session is even created. - Permissions: Simply enabling the service isn’t enough; the user account must be part of the Remote Desktop Users group or have Administrative privileges.
- BlueKeep & Vulnerabilities: Ensure your server is fully patched if you are exposing RDP, as unpatched legacy servers are prime targets for ransomware.
#WindowsServer #RDP #RemoteDesktop #SysAdmin #ITPro #PowerShell #RegistryHacks #LazyAdmin #TechTips #ServerSecurity
How to Fix: Keyboard or Mouse Not Working in a VMware Virtual Machine

It’s a frustrating classic: you click into your VM, and… nothing. The cursor doesn’t move, or the keyboard acts like it’s unplugged. Usually, this is a “focus” or driver issue rather than a hardware failure.
Here is the “Lazy Admin” checklist to get your inputs back online.
1. The “Focus” Check (The Most Common Culprit)
Virtualization software intercepts your hardware inputs. If the VM window doesn’t have “Focus,” your typing is still going to your host OS.
- Action: Click anywhere inside the VM console window.
- Pro Tip: Look at the bottom status bar of your VMware window. If the mouse icon isn’t lit up, the VM isn’t “grabbing” the input.
2. The Wireless Device “Passthrough” Trap
If you are using a wireless USB mouse/keyboard, the VM might have accidentally “claimed” the USB receiver for itself, cutting it off from the host.
- Action: Go to VM > Removable Devices and ensure your HID (Human Interface Device) is Disconnected from the VM so the host can manage it and pass the input through the software layer instead.
- Alternative: Remove the USB Controller from the VM settings and re-add it to reset the bus.
3. Driver Conflicts & Optimization
Sometimes, fancy “Gaming” drivers (Logitech G-Hub, Razer Synapse) inside the guest OS conflict with the VMware virtual driver.
- Action: Uninstall any non-standard mouse/keyboard software inside the VM.
- Optimization: In VMware Workstation settings, go to Preferences > Input and set “Optimize mouse for games” to Always or Automatic.
4. The Nuclear Option: Reinstall VMware Tools
The VMware Tools package includes the specialized vmmouse driver that handles smooth cursor movement and keyboard mapping. If this is corrupted, your input will fail.
- Action: 1. Press
Ctrl + Altto release your mouse to the host. 2. Go to VM > Install (or Reinstall) VMware Tools. 3. Use the keyboard (Tab and Spacebar) if the mouse isn’t working to navigate the installer.
5. Troubleshooting the Host (OS-Specific)
If the issue persists, the problem might be a service on your physical computer blocking the input stream.
- Windows Hosts: Run
msconfigto perform a “Clean Boot,” disabling non-Microsoft services to see if a background app is interfering. - Linux Hosts: Drop to Run Level 2 to disable start daemons and test the raw input.
#VMware #Virtualization #SysAdmin #ITSupport #TechTips #LazyAdmin #VMwareWorkstation #vSphere #WindowsTips #LinuxTips
Understanding Processor Queue Length

In simple terms, Processor Queue Length is the “waiting room” for your CPU. It represents the number of threads that are ready to be processed but are currently stuck waiting because the CPU is already busy handling other tasks.
🚦 The Core Concept: Threads in Waiting
Every action on your server—whether it’s a database query or a system background task—is broken down into threads. The CPU can only handle a certain number of threads at once. When more threads arrive than the CPU can handle, they line up in the Processor Queue.
📉 Identifying a Bottleneck
A high CPU utilization percentage (e.g., 90%) doesn’t always mean there is a problem. The true indicator of a performance bottleneck is a sustained or recurring queue.
- The Golden Rule: A sustained queue of more than two threads per processor is a clear symptom of a bottleneck.
- The Exception: Queues can develop even when CPU utilization is below 90% if the requests are random and the processing time for each thread varies wildly.
🔍 How to Troubleshoot a High Queue
If you notice frequent queueing, you need to dig into the specific processes causing the backup.
- Check % Processor Time: Identify which specific processes are eating up CPU cycles.
- Monitor Thread Patterns: Use Performance Monitor (PerfMon) to see if a single process is spawning too many threads.
- Evaluate Priorities: Check if certain low-priority tasks are holding up high-priority ones. While you can adjust base priorities in Task Manager, this is usually a “band-aid” fix, not a permanent solution.
🖥️ Multiprocessor Systems: Calculating the Limit
The acceptable queue length scales with your hardware. To find your target range, multiply your number of physical processors (or cores) by the thread threshold.
| System Type | Typical Usage (0–10% CPU) | Busy System (80–90% CPU) |
| Single Processor | 0 to 1 threads | 1 to 3 threads |
| Dual Processor | 0 to 1 threads | 2 to 6 threads |
| Quad Processor | 0 to 1 threads | 4 to 12 threads |
Note: For servers, also keep an eye on the Server Work Queues\Queue Length counter, which specifically tracks requests waiting for the server service.
#WindowsServer #SysAdmin #PerformanceTuning #ITPro #TechTips #CPU #DataCenter #ServerManagement #LazyAdmin #PerfMon
Syslog Server storage logs size calculation

Upgrading your syslog retention is a great move for troubleshooting depth, but as your math shows, it comes with a significant increase in storage demands. Moving from 4GB to 40GB is a 10x jump, so ensuring your volume can handle the growth is critical.
Here is the breakdown of the calculation and the step-by-step guide to applying these changes.
📊 Syslog Storage Planning
Before modifying configuration files, verify your available disk space. Using your specific requirements for 100 hosts:
| Variable | Current Setting | Desired Setting |
| Max Log Size | 2 MB | 10 MB |
| Rotation Count | 20 Files | 40 Files |
| Retention per Host | 40 MB | 400 MB |
| Total Storage (100 Hosts) | 4,000 MB (4GB) | 40,000 MB (40GB) |
⚠️ A Note on Scalability
While you are planning for 100 hosts, keep in mind that the VMware Syslog Collector for Windows is officially supported for up to 30 hosts.
- The Risk: Beyond 30 hosts, the service may stop responding or drop logs without an error message.
- The Fix: If you need to support 100 hosts reliably, consider deploying multiple collectors or moving to a high-scale solution like VMware vRealize Log Insight.
🛠️ How to Modify Syslog Collector Configuration
To apply your new 10MB / 40 Rotate policy, you must manually edit the configuration XML.
1. Locate and Backup
Before editing, create a copy of the configuration file.
- vCenter 6.0:
%PROGRAMDATA%\VMware\vCenterServer\cfg\vmsyslogcollector\config.xml - vCenter 5.5 & older:
%PROGRAMDATA%\VMware\VMware Syslog Collector\vmconfig-syslog.xml
2. Edit the XML
Open the copy in a text editor (like Notepad++) and locate the <defaultValues> section. Update the values as follows:
<defaultValues> <port>514</port> <protocol>TCP,UDP</protocol> <maxSize>10</maxSize> <rotate>40</rotate> <sslPort>1514</sslPort></defaultValues>
3. Swap and Restart
- Stop the Service: Open
services.mscand stop the VMware Syslog Collector. - Replace File: Delete the original
config.xmland rename your modified copy to the original filename. - Start the Service: Restart the VMware Syslog Collector.
Lazy Admin Tip: If the logs don’t start flowing immediately, you may need to restart the syslog service on the ESXi hosts themselves to re-establish the connection to the server.
#VMware #vSphere #Syslog #DataCenter #Storage #SysAdmin #ITPro #Virtualization #LogManagement #LazyAdmin #TechGuide
How to Restart Management Agents on an ESXi Host?

When an ESXi host appears as “Not Responding” in vCenter, or the Web Client becomes sluggish, you don’t always need to reboot the entire server. Often, simply restarting the Management Agents (hostd and vpxa) will restore connectivity without interrupting your running Virtual Machines.
Method 1: Using the Direct Console User Interface (DCUI)
If you have physical access to the server or a remote management console (like iDRAC, ILO, or IPMI), this is the safest method.
- Connect to your ESXi host console and press F2 to customize the system.
- Log in as root.
- Navigate to Troubleshooting Options using the arrow keys.
- Select Restart Management Agents.
- Press Enter, then press F11 to confirm the restart.
- Once finished, press Esc to log out.
Method 2: Using SSH or Local Shell
If SSH is enabled, you can restart the specific agents individually. This is the preferred “Lazy Admin” method as it provides granular control.
For ESXi 5.x, 6.x, and 7.x/8.x: Run these two commands to restart the host agent and the vCenter agent:
Bash
/etc/init.d/hostd restart/etc/init.d/vpxa restart
For legacy ESXi 4.x:
Bash
/etc/init.d/hostd restartservice vmware-vpxa restart
Method 3: The “Nuclear” Option (services.sh)
If the individual agent restarts don’t work, you can restart all management services on the host.
Command:
Bash
services.sh restart
⚠️ CRITICAL CAUTION
If LACP is enabled on your Distributed Virtual Switch (DVS), do not use
services.sh restart. Doing so can disrupt network connectivity. Instead, restart independent services or schedule a maintenance window.
Method 4: Resetting the Management Network
Sometimes the issue isn’t the agent, but the VMkernel interface itself. You can bounce the management interface (usually vmk0) with this one-liner:
Bash
esxcli network ip interface set -e false -i vmk0; esxcli network ip interface set -e true -i vmk0
The semicolon ensures the interface comes back up immediately after being disabled.
#VMware #ESXi #vSphere #SysAdmin #ITPro #Virtualization #Troubleshooting #LazyAdmin #DataCenter #TechTips #CloudAdmin
