Category Archives: .NET

Time oddity

I was looking for a test of time synchronisation on domain controllers and knew that the .NET domain controller object held a system property. So, I cam up with this $dom = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()$dom.DomainControllers | Format-Table Name, CurrentTime What I didn’t … Continue reading

Posted in .NET, Active Directory, Powershell, PowerShell and WMI | Leave a comment

Set registry key owner

In chapter 7 of PowerShell and WMI I stated that I would post a .NET version of a script to set ownership of a registry key. The WMI method needs Vista or above so we need the .NET version for … Continue reading

Posted in .NET, IT Security, PowerShell V2 | Leave a comment

Create a process on a remote machine

We cam use the [wmiclass] to create a process but it doesn’t allow us to set the credentials. We can get round that by using a bit of .NET code. [wmiclass] is as accelerator for System.Management.ManagementClass so we go back … Continue reading

Posted in .NET, PowerShell and WMI | Leave a comment

A count down timer

Last month I started playing with WPF to show how a multi-coloured clock could  be displayed on screen. This was picked up and an easier version was created by Doug Finke using the ShowUI module from codeplex  http://showui.codeplex.com/. Other links … Continue reading

Posted in .NET, PowerShell V2, WPF | Leave a comment

Using enums

Following on my post about using enums http://msmvps.com/blogs/richardsiddaway/archive/2011/08/02/enums.aspx I thought it might be fun to see how we can make our own. If we look at Win32_LogicalDisk PS > Get-WmiObject Win32_LogicalDisk | ft DeviceID, DriveType -a DeviceID DriveType——– ———C:               3E:               … Continue reading

Posted in .NET, PowerShell and WMI, PowerShell V2 | Leave a comment

Enums

No not something added to your food but .NET enumerations. These are collections of defined values such as the default folder names that we have seen in Outlook. An enumeration (to use the full name) looks a bit like a … Continue reading

Posted in .NET, PowerShell V2 | Leave a comment