Labels

Showing posts with label WMI. Show all posts
Showing posts with label WMI. Show all posts

Friday, August 29, 2008

Converting filetime with vbs and PowerShell

This post provides two methods of converting the 64-bit Windows filetime structure - the Windows Epoch giving the number of 100 nanosecond intervals since 01/01/1601 UTC.

The first is PowerShell which is relatively easy, compared to the second which is some VBScript that I have used upon occasion, typically when I'm trying to convert 64-bit integers from AD (eg returned from dsquery pwdlastset), or vice versa.

Neither of these scripts are revolutionary, but I haven't come across a simple function to convert between the two in vbs, and I thought I'd include the powershell for comparison.


# ConvertFileTime.ps1
$now = [datetime]::Now
$now

$fileTime = $now.ToFileTime()
$fileTime 
[datetime]::FromFileTime($fileTime)

# This then parses the date, determining whether it is a valid date or not (in this case it always will be beacuse it's from datetime, but you could use this to parse other date strings, using your culture)
foreach ($date in [string[]]$now.ToString()) {
  write-output $date
  $oCulture= [System.Globalization.CultureInfo]"en-AU"
  $dtOut = new-object DateTime
  [datetime]::TryParse($date, $oCulture, [System.Globalization.DateTimeStyles]::None, [ref]$dtOut)
  [datetime]::TryParse($date, [ref]$dtOut)
}

-

' ConvertFileTime.vbs
' VBScript doesn't support 64-bit integers, so it can't handle the number of 100 nanosecond intervals since 01/01/1601
' http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnclinic/html/scripting09102002.asp

' Either use ADSI provider and the IADs/IADsLargeInteger object
' LargeIntValue = objLargeInt.HighPart * 2^32 + objLargeInt.LowPart
' http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adsi/adsi/iadslargeinteger.asp'

' Or WMI, which handles the conversion between 64-bit datetime structure / UTC / and VB var datetime

If Wscript.Arguments.UnNamed.Count > 0 Then 
 strDateTime = Wscript.Arguments.UnNamed(0)

 Set objDateTime = CreateObject("WbemScripting.SWbemDateTime")

 If IsDate(strDateTime) Then
  Call objDateTime.SetVarDate(strDateTime, False)
  wscript.echo objDateTime.GetFileTime
 Else
  Call objDateTime.SetFileTime(strDateTime, False)
  wscript.echo objDateTime.GetVarDate
 End If

 intReturn = 0
Else
 WScript.Echo "Specify a filetime or a date to convert, eg 127076450620627215, or ""11/04/2006 11:17:10 AM"""
 intReturn = 2
End If

WScript.Quit(intReturn)

Wayne's World of IT (WWoIT), Copyright 2008 Wayne Martin.


Read more!

Saturday, August 2, 2008

WMIC XSL CSV output formatting

While using the wmic command with the /format:csv option, it occurred to me that it would be useful to reformat numbers if appropriate and have the CSV fields enclosed in quotes to allow outputting fields containing commas.

Take a copy of the %windir%\system32\wbem\csv.xsl (I've called mine csv2.xsl in this example), and modify the template match for 'VALUE' to the line below:
<xsl:template match="VALUE" xml:space="preserve">"<xsl:choose><xsl:when test="string(number(.))='NaN'"><xsl:value-of select="."/></xsl:when><xsl:when test=". > 1000000000"><xsl:value-of select="string(format-number(.,'###,###,###'))"/></xsl:when><xsl:otherwise><xsl:value-of select="."/></xsl:otherwise></xsl:choose>"</xsl:template>

This will:

  • Check if the value is a number
  • If not, output as normal.
  • If it is a number, and if the number is greater than 1000000000, reformat with commas as thousand separators.
  • If if is a number, and less than 1000000000, output as normal.
    Output the results with quotes surrounding the data, useful when the data may contain comma's (as in this case)

I find this useful when I'm querying remote machines for their free/total disk space, when the number comes back as a daunting 227770765312 bytes, which is much easier to interpret when reformatted as 227,770,765,312 (~227GB or ~212 depending on whether you're a 1000 or 1024 kind of person)

A query using this modified xsl transform:

wmic /node:"server-01","server-02","server-03" path Win32_LogicalDisk WHERE "FileSystem='NTFS' AND Name != 'C:' AND Name != 'D:'" GET Name,Size,FreeSpace,VolumeName /format:csv2

Note the double-quotes surrounding the node-names, which is required when a server name contains a hyphen. When specifying more than one node by commas, each node is surrounded by quotes.

You could also actually divide the number by (/1024/1024/1024) to give a GB figure, or any other number of output modifications to the original data.

Note that when redirecting the wmic command to file it will result in a Unicode file, and by default when loading a .csv in Excel it won't split the columns automatically.

To output as UTF-8, you can either:

  • Modify the xsl output element to use a different encoding to the default utf-16, such as utf-8 or us-ascii
  • Use the 'type' command - eg. type output.csv output8.csv will take a Unicode file and provide as ASCII output


Wayne's World of IT (WWoIT), Copyright 2008 Wayne Martin.


Read more!

Thursday, July 24, 2008

WMIC Custom Alias and Format

This post describes my first attempt at creating a WMIC alias, which provides an easy way of allowing people to run complex queries with a single alias.

Note that while creating new WMIC aliases provides a very flexible and transportable solution, another very useful part of WMIC discussed here is the use of the 'format' command to format the output in one of many formats - CSV, XML, HTML tables - or passed through any custom XSL.

The examples here provide an alias and output of printer jobs from a cluster node, using the perfdata information, which combined with HTML table output, provides a repeatable method of displaying print spooler information on a 2003 cluster node.

As a summary, this post describes using WMIC to:

  • Use the format command to modify output, using either an alias or a path/get command
  • Create, compile and run a custom alias using WMIC
  • Modify one of the builtin XSL files to allow sorting by ascending/descending

The Format option

The following commands provide different examples of formatting output as CSV from a path/get command, as well as various combinations of using the custom alias created below.

Use WMIC to get instances of a class and format the output as CSV
wmic path win32_process get name,commandline /format:csv

Use WMIC aliases to format the output in CSV or XML
wmic process list /format:xml
wmic process list /format:csv

Use WMIC aliases to format the output in HTML TABLE, MOFCSV or XML
wmic process list /format:htable
wmic process list /format:HMOF

Use WMIC aliases to sort the output in HTML
wmic process list /format:htable:"sortby=Name" > test.html

Use WMIC aliases to filter and sort the output in CSV
wmic process get name /format:csv:"datatype=text":"sortby=Name"

Use WMIC remotely aliases to retrieve command-line process arugments
wmic /node:"%server%" process get name,CommandLine /format:csv:"sortby=Name"

Use WMIC wmic aliases to sort the result set by number
wmic Logon get /Format:htable:"datatype=number":"sortby=LogonType"

Use a custom WMIC alias to report printer info from a cluster node in CSV
wmic /node:"%server%" spoolerjobs list /format:table

Use a custom WMIC alias to report sorted HTML printer info from a cluster node
wmic /node:"%server%" spoolerjobs list /format:htable:"datatype=number":"sortby=TotalJobsPrinted"

Use a custom WMIC alias to report a brief summary of printer statistics
wmic /node:"%server%" spoolerjobs list brief /format:htable:"datatype=number":"sortby=TotalJobsPrinted"

Use a custom WMIC alias and xsl to sort print jobs output descending HTML table
wmic /node:"%server%" spoolerjobs list brief /format:"htabledesc-sortby.xsl":"datatype=number":"orderby=descending":"sortby=TotalJobsPrinted" > test.html

Query a user from AD using WMI
wmic /node:"%DC%" /namespace:\\root\directory\LDAP path ds_user where "ds_cn='%username%'" GET ds_displayName,DS_UserPrincipalName,ds_cn,ds_name,ds_whenCreated


Create, compile and run a custom alias using WMIC

The following steps were taken to created and compile the MOF file:

  1. Use the CIM Studio, root\cli namespace
  2. Select the MSFT_CliAlias Class
  3. Double-click the 'MOF Generator' button (top-right, next to 'MOF Compiler' which is next to the help icons).
  4. Select at least one instance of the class to export as well. The 'Startup' alias is relatively simple and was used in this example
  5. Choose a filename and path
  6. Remove the class definition from the MOF
  7. Modify the instance definition -
    1. Create/modify MSFT_CliProperty properties to set the derivation, description and name as appropriate for the data you are retrieving
    2. Add qualifiers to the objects as appropriate, providing greater integrity of the dataset
    3. Change the FriendlyName to be the new alias name, and the target WMI query
    4. Use the PWhere attribute to specify an optional where query clause with the value specified at the command prompt
  8. Use mofcomp -check to validate the MOF
  9. Use mofcomp to compile into the repository

To customise the XSL to add the ability to sort by ascending or descending in the htable output:

  1. copy c:\WINDOWS\system32\wbem\htable-sortby.xsl c:\WINDOWS\system32\wbem\htabledesc-sortby.xsl
  2. Add parameter: <xsl:param name="orderby" select="'ascending'"/>
  3. In the XSL:Sort element, add: order="{$orderby}"

The MOF file:



//**************************************************************************
//* File: ClusterPrintJobs.mof
//**************************************************************************

// References:
// 
// Win32_PerfFormattedData_Spooler_PrintQueue Class
// http://msdn.microsoft.com/en-us/library/aa394288(VS.85).aspx
//
// Creating and editing formats in WMIC
// http://technet2.microsoft.com/windowsserver/en/library/32757e77-daa3-461a-8576-10242178de581033.mspx?mfr=true
//
// Creating and editing aliases
// http://technet2.microsoft.com/windowsserver/en/library/fd84c63a-d94d-4adc-99c2-8f71d7494c5d1033.mspx

// Author:  Wayne Martin
// Date:    22/07/2008
//
// 
// Example uses:
// Use a custom WMIC alias to report printer info from a cluster node in CSV:
//   wmic /node:"b%server%" spoolerjobs list /format:table
//
// Use a custom WMIC alias to report sorted HTML printer info from a cluster node:
//   wmic /node:"%server%" spoolerjobs list /format:htable:"datatype=number":"sortby=TotalJobsPrinted"
//
// Use a custom WMIC alias to report a brief summary of printer statistics
//   wmic /node:"%server%" spoolerjobs list brief /format:htable:"datatype=number":"sortby=TotalJobsPrinted"
//
// Use a custom WMIC alias and xsl to sort print jobs output descending HTML table
//   wmic /node:"%server%" spoolerjobs list brief /format:"htabledesc-sortby.xsl":"datatype=number":"orderby=descending":"sortby=TotalJobsPrinted" > test.html 


//**************************************************************************
//* This MOF was generated from the "\\.\ROOT\cli"
//* namespace on machine "-".
//* To compile this MOF on another machine you should edit this pragma.
//**************************************************************************
#pragma namespace("\\\\.\\ROOT\\cli")


//**************************************************************************
//* Instances of: MSFT_CliAlias
//**************************************************************************
instance of MSFT_CliAlias
{
 Connection = 
 instance of MSFT_CliConnection
 {
  Locale = "ms_409";
  NameSpace = "ROOT\\CIMV2";
  Server = ".";
 };
 Description = "List print jobs for each printer on the specified node, and spooler totals.";
 Formats = {
  instance of MSFT_CliFormat
  {
   Name = "SYSTEM";
   Properties = {
    instance of MSFT_CliProperty
    {
     Derivation = "__CLASS";
     Name = "__CLASS";
    }, 
    instance of MSFT_CliProperty
    {
     Derivation = "__DERIVATION";
     Name = "__DERIVATION";
    }, 
    instance of MSFT_CliProperty
    {
     Derivation = "__DYNASTY";
     Name = "__DYNASTY";
    }, 
    instance of MSFT_CliProperty
    {
     Derivation = "__GENUS";
     Name = "__GENUS";
    }, 
    instance of MSFT_CliProperty
    {
     Derivation = "__NAMESPACE";
     Name = "__NAMESPACE";
    }, 
    instance of MSFT_CliProperty
    {
     Derivation = "__PATH";
     Name = "__PATH";
    }, 
    instance of MSFT_CliProperty
    {
     Derivation = "__PROPERTY_COUNT";
     Name = "__PROPERTY_COUNT";
    }, 
    instance of MSFT_CliProperty
    {
     Derivation = "__RELPATH";
     Name = "__RELPATH";
    }, 
    instance of MSFT_CliProperty
    {
     Derivation = "__SERVER";
     Name = "__SERVER";
    }, 
    instance of MSFT_CliProperty
    {
     Derivation = "__SUPERCLASS";
     Name = "__SUPERCLASS";
    }
   };
  }, 
  instance of MSFT_CliFormat
  {
   Name = "INSTANCE";
   Properties = {
    instance of MSFT_CliProperty
    {
     Derivation = "Name";
     Description = "the print queue. ";
     Name = "Name";
     Qualifiers = {
      instance of MSFT_CliQualifier
      {
       Name = "MaxLen";
       QualifierValue = {"64"};
      }
     };
    }
   };
  }, 
  instance of MSFT_CliFormat
  {
   Format = "LIST";
   Name = "FULL";
   Properties = {
    instance of MSFT_CliProperty
    {
     Derivation = "Name";
     Description = "Name of the print queue.";
     Name = "Name";
    }, 
    instance of MSFT_CliProperty
    {
     Derivation = "Jobs";
     Description = "Current number of jobs in a print queue.";
     Name = "Jobs";
    }, 
    instance of MSFT_CliProperty
    {
     Derivation = "TotalJobsPrinted";
      Description = "Total number of jobs printed on a print queue after the last restart.";
      Name = "TotalJobsPrinted";
    }, 
    instance of MSFT_CliProperty
    {
     Derivation = "TotalPagesPrinted";
     Description = "Total number of pages printed through GDI on a print queue after the last restart.";
     Name = "TotalPagesPrinted";
    }, 
    instance of MSFT_CliProperty
    {
     Derivation = "MaxJobsSpooling";
     Description = "Maximum number of spooling jobs in a print queue after the last restart.";
     Name = "MaxJobsSpooling";
    }, 
    instance of MSFT_CliProperty
    {
     Derivation = "JobErrors";
     Description = "Total number of job errors in a print queue after the last restart.";
     Name = "JobErrors";
    }, 
    instance of MSFT_CliProperty
    {
     Derivation = "OutOfPaperErrors";
     Description = "Total number of out-of-paper errors in a print queue after the last restart.";
     Name = "OutOfPaperErrors";
     Qualifiers = {
      instance of MSFT_CliQualifier
      {
       Name = "CookingType";
       QualifierValue = {"PERF_COUNTER_RAWCOUNT"};
      },
      instance of MSFT_CliQualifier
      {
       Name = "Counter";
       QualifierValue = {"OutofPaperErrors"};
      },
      instance of MSFT_CliQualifier
      {
       Name = "PerfTimeStamp";
       QualifierValue = {"Timestamp_PerfTime"};
      },
      instance of MSFT_CliQualifier
      {
       Name = "PerfTimeFreq";
       QualifierValue = {"Frequency_PerfTime"};
      }
     };
    }
   };
  }, 
  instance of MSFT_CliFormat
  {
   Format = "TABLE";
   Name = "BRIEF";
   Properties = {
    instance of MSFT_CliProperty
    {
     Derivation = "Name";
     Description = "Name of the print queue.";
     Name = "Name";
    }, 
    instance of MSFT_CliProperty
    {
     Derivation = "TotalJobsPrinted";
     Description = "Total number of jobs printed on a print queue after the last restart.";
     Name = "TotalJobsPrinted";
    }, 
    instance of MSFT_CliProperty
    {
     Derivation = "TotalPagesPrinted";
     Description = "Total number of pages printed through GDI on a print queue after the last restart.";
     Name = "TotalPagesPrinted";
    }
   };
  }
 };
 FriendlyName = "SpoolerJobs";
 //PWhere = "where Caption='#'";
 Target = "Select Name,Jobs,TotalJobsPrinted,TotalPagesPrinted,MaxJobsSpooling,JobErrors,OutOfPaperErrors from Win32_PerfFormattedData_Spooler_PrintQueue";
};

//* EOF ClusterPrintJobs.mof


References:

WMI Adminsitrative Tools (contains CIM Studio):
http://www.microsoft.com/downloads/details.aspx?FamilyID=6430f853-1120-48db-8cc5-f2abdc3ed314

Wayne's World of IT (WWoIT), Copyright 2008 Wayne Martin.


Read more!

Thursday, March 27, 2008

WMI filter for subnet filtered Group Policy

This post describes a WMI filter used to provide Group Policy based on the client subnet. This can be useful when site-based policy is not appropriate, or for more granular control of specific subnets within sites.

The WMI filter used:


Select * FROM Win32_IP4RouteTable
WHERE ((Mask='255.255.255.255' AND NextHop='127.0.0.1')
AND (Destination Like '10.0.0.%' OR Destination Like '10.0.1.%' OR Destination Like '10.0.2.%'))



Originally this was used to define a DNS suffix search list for computers on a particular subnet. Other potential uses include branding and hardening of clients on specific subnets, such as privileged network or remote access subnets.

Why the Win32_IP4RouteTable class was used in the WMI query:

  • Using the routing table to determine the local IP is not very intuitive, it would make more sense to use something like win32_networkadapterconfiguration, but the relevant information is stored in arrays, which cannot currently be processed by WMI filters. (or WMI queries in WHERE clauses)
  • The route table is filtered to ensure only the local address is processed by including only the local broadcast address and the localhost hop, and then checking the subnet. Note that a /24 is the only subnet size that will be accurate when validating only on the last octet (the query above).

GPMC limitations:

  1. GPMC Modelling doesn't seem accurate, ie. some XPSP2 workstations processing this policy return True for the WMI filter, even though 'gpresult /z' on the workstation accurately reports that the WMI filter caused the policy to not apply.

Using UserEnv Debugging to verify:

  1. reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v UserEnvDebugLevel /d 0x00010002 /t reg_dword
  2. gpupdate /force /target:computer

c:\windows\debug\netlogon.log should then show something like:

   USERENV(1c8.650) 00:30:03:191 FilterCheck: Found WMI Filter id of: <[domain.com;{B3942687-E8A9-4602-9365- E4C617980939};0]> 

USERENV(1c8.650) 00:30:03:253 ProcessGPO: GPO passes the filter check.

Other options considered to provide a similar result:

  1. A security group filtered GPO, which would require manually adding and removing computers (or potentially automated with an export from DHCP that automatically added computers from the subnets to the security group)
  2. DHCP Scope option for configuring the DNS suffix search list (119 I think) - not currently supported by XP
  3. Some form of DHCP Scope ID that is recognised in XP and can be read through WMI or the registry
  4. DHCP Option 61 - Unique scope ID read from the registry (http://support.microsoft.com/kb/172408)
  5. AD Site - Separate sites containing the subnets, with a site-based group policy (although SDOU suggests this wouldn't work, as the OU policy would overwrite the site based policy - the closer to the object the higher priority)
  6. Something in an automated process running on each workstation that would determine network changes and make local changes.


Wayne's World of IT (WWoIT), Copyright 2008 Wayne Martin.


Read more!

Sunday, March 9, 2008

Find where a user is connecting from through WMI

It’s often good to know which computer a user is on right now, but historically that’s not that very easy to find – until FU that is.

The logic behind this command is that generally every user has a home drive, and that home drive is mapped during logon. The lanmanserver service on the file server has the session details of which user has connected from which computer/IP.

Therefore, by querying the win32_serversession of the file server, you can determine where users are connecting from, which will tell you the workstation they are currently working on.

Note that this command requires dsquery, dsget and WMIC. It also requires access to the file server to enumerate sessions (see below for more information).

You can run this at the command prompt:
Set user=%username%
for /f "tokens=2 delims=\" %i in ('"dsquery user -name %user% dsget user -hmdir find /i "%user%""') do @for /f "skip=1 tokens=1-3" %m in ('"wmic /node:"%i" path win32_serversession WHERE "UserName Like '%user%'" Get ComputerName,ActiveTime,IdleTime"') do @for /f "tokens=2" %q in ('"ping -a %n -n 1 find /i "pinging""') do @echo %q %user% %n %i %m %o

Note that you can also use partial username matches, the WMI query is a like clause.

I realise that’s not easy to type in, so you can use a doskey macro, by:

  • Putting the command below in a text file (c:\windows\temp\macro.txt in this example)
  • Running doskey /macrofile=c:\windows\temp\macro.txt

To make doskey load the macros every time you start a command shell, run:

reg add "HKEY_LOCAL_MACHINE\software\microsoft\command processor" /v autorun /t REG_SZ /d "doskey /macrofile=c:\windows\temp\macros.txt"

You can then run:

fu %username1% [%username2%] [%username3%]

Which will return the computername, username, IP address, active time and idle time of the user you’ve asked for.

Unfortunately, securing this is quite hard. I'm embarrassed to report that the user needs to be an administrator or 'server operator' of the file server. As far as I can tell this comes back to the NetSessionEnum() function, called by the Win32_Session WMI class when enumerating sessions.

The NetSessionEnum function call allows non-administrators to enumerate level 0 or 10, but it appears as though WMI always queries for level 1 or 2 (even if you only query the WMI class for user/computer). This is very disappointing, as in a secure environment you won’t want to let help desk/desktop support be server operators of your file servers, and these are the people who would find this command most useful.

I went some way towards seeing whether you could adjust a securable object/low-level security descriptor object (eg. through winobj) to expand the allowed access to this information, but was unsuccessful.

Some other thoughts:
  • Psloggedon uses the netsessionenum function, and it does tell you that someone is logged on remotely, but unfortunately it doesn’t provide the computer, only the username and time.
  • PowerShell could probably be used to call the NetSessionEnum function easily enough with the reduced information levels that don’t require administrative privileges
As an aside, if you do want to allow non-administrators generic CIMv2 WMI access to a 2003 server, you can do this by:
  • Add a group to wmimgmt.msc to provide 'enable account' and 'remote enable' to the root\CIMv2 namespace.
  • Add the same group to the local 'Distributed COM Users' (Server 2003) on each WMI target. This provides remote access for DCOM calls.
After you've done this, a command such as the following should work:
wmic /user:"%domain%\%user%" /node:"%fileServer%" path win32_operatingsystem

Note that users given this limited access cannot:
  • Execute WMI methods
  • Write data through WMI providers

References:
The Win32_ServerSession Windows Management Instrumentation class returns incorrect server session instances on a Windows Server 2003-based computer

http://support.microsoft.com/kb/903931

NetSessionEnum Function
http://msdn2.microsoft.com/en-us/library/bb525382(VS.85).aspx

Low-level Security Descriptor Functions
http://msdn2.microsoft.com/en-us/library/aa379204(VS.85).aspx

Securable Objects
http://msdn2.microsoft.com/en-us/library/aa379557(VS.85).aspx

Access to WMI Securable Objects
http://msdn2.microsoft.com/en-us/library/aa822576(VS.85).aspx


Wayne's World of IT (WWoIT), Copyright 2008 Wayne Martin.


Read more!

All Posts

printQueue AD objects for 2003 ClusterVirtualCenter Physical to VirtualVirtual 2003 MSCS Cluster in ESX VI3
Finding duplicate DNS recordsCommand-line automation – Echo and macrosCommand-line automation – set
Command-line automation - errorlevels and ifCommand-line automation - find and findstrBuilding blocks of command-line automation - FOR
Useful PowerShell command-line operationsMSCS 2003 Cluster Virtual Server ComponentsServer-side process for simple file access
OpsMgr 2007 performance script - VMware datastores...Enumerating URLs in Internet ExplorerNTLM Trusts between 2003 and NT4
2003 Servers with Hibernation enabledReading Shortcuts with PowerShell and VBSModifying DLL Resources
Automatically mapping printersSimple string encryption with PowerShellUseful NTFS and security command-line operations
Useful Windows Printer command-line operationsUseful Windows MSCS Cluster command-line operation...Useful VMware ESX and VC command-line operations
Useful general command-line operationsUseful DNS, DHCP and WINS command-line operationsUseful Active Directory command-line operations
Useful command-linesCreating secedit templates with PowerShellFixing Permissions with NTFS intra-volume moves
Converting filetime with vbs and PowerShellDifference between bat and cmdReplica Domain for Authentication
Troubleshooting Windows PrintingRenaming a user account in ADOpsMgr 2007 Reports - Sorting, Filtering, Charting...
WMIC XSL CSV output formattingEnumerating File Server ResourcesWMIC Custom Alias and Format
AD site discoveryPassing Parameters between OpsMgr and SSRSAnalyzing Windows Kernel Dumps
Process list with command-line argumentsOpsMgr 2007 Customized Reporting - SQL QueriesPreventing accidental NTFS data moves
FSRM and NTFS Quotas in 2003 R2PowerShell Deleting NTFS Alternate Data StreamsNTFS links - reparse, symbolic, hard, junction
IE Warnings when files are executedPowerShell Low-level keyboard hookCross-forest authentication and GP processing
Deleting Invalid SMS 2003 Distribution PointsCross-forest authentication and site synchronizati...Determining AD attribute replication
AD Security vs Distribution GroupsTroubleshooting cross-forest trust secure channels...RIS cross-domain access
Large SMS Web Reports return Error 500Troubleshooting SMS 2003 MP and SLPRemotely determine physical memory
VMware SDK with PowershellSpinning Excel Pie ChartPoke-Info PowerShell script
Reading web content with PowerShellAutomated Cluster File Security and PurgingManaging printers at the command-line
File System Filters and minifiltersOpsMgr 2007 SSRS Reports using SQL 2005 XMLAccess Based Enumeration in 2003 and MSCS
Find VM snapshots in ESX/VCComparing MSCS/VMware/DFS File & PrintModifying Exchange mailbox permissions
Nested 'for /f' catch-allPowerShell FindFirstFileW bypassing MAX_PATHRunning PowerSell Scripts from ASP.Net
Binary <-> Hex String files with PowershellOpsMgr 2007 Current Performance InstancesImpersonating a user without passwords
Running a process in the secure winlogon desktopShadow an XP Terminal Services sessionFind where a user is logged on from
Active Directory _msdcs DNS zonesUnlocking XP/2003 without passwords2003 Cluster-enabled scheduled tasks
Purging aged files from the filesystemFinding customised ADM templates in ADDomain local security groups for cross-forest secu...
Account Management eventlog auditingVMware cluster/Virtual Center StatisticsRunning scheduled tasks as a non-administrator
Audit Windows 2003 print server usageActive Directory DiagnosticsViewing NTFS information with nfi and diskedit
Performance Tuning for 2003 File ServersChecking ESX/VC VMs for snapshotsShowing non-persistent devices in device manager
Implementing an MSCS 2003 server clusterFinding users on a subnetWMI filter for subnet filtered Group Policy
Testing DNS records for scavengingRefreshing Computer Account AD Group MembershipTesting Network Ports from Windows
Using Recovery Console with RISPAE Boot.ini Switch for DEP or 4GB+ memoryUsing 32-bit COM objects on x64 platforms
Active Directory Organizational Unit (OU) DesignTroubleshooting computer accounts in an Active Dir...260+ character MAX_PATH limitations in filenames
Create or modify a security template for NTFS perm...Find where a user is connecting from through WMISDDL syntax in secedit security templates

About Me

I’ve worked in IT for over 20 years, and I know just about enough to realise that I don’t know very much.