Monthly Archives: May 2008

PowerShell Reference Card

Bruce Payette (PowerShell in Action) has produced a 8 page reference card for the PowerShell language.   http://blogs.msdn.com/powershell/archive/2008/05/30/new-free-windows-powershell-quick-reference-card.aspx Its available as a free download (registration required) from http://refcardz.dzone.com/ For anyone learning PowerShell (or if you are as forgetful as me) this … Continue reading

Posted in Powershell | 1 Comment

Event Logs

PowerShell V1 enabled us to read information from the event logs.   To see the event logs available use PS> Get-EventLog * Max(K) Retain OverflowAction        Entries Name  ——   ——  ————–               ——- —-  20,480      0 OverwriteAsNeeded       4,851 Application  15,168      0 OverwriteAsNeeded           0 … Continue reading

Posted in Powershell | Leave a comment

Account management – local users

Creating a local user account is very similar to creating a domain account that I showed here – http://richardsiddaway.spaces.live.com/default.aspx?_c01_BlogPart=blogentry&_c=BlogPart&handle=cns!43CFA46A74CF3E96!1358 ## To create a user on the local machine## add the assemblyAdd-Type -AssemblyName System.DirectoryServices.AccountManagement ## create a password$password = Read-Host "Password" … Continue reading

Posted in Powershell | Leave a comment

More Hyper-V

Dung has another instalment in his excellent series on Hyper-V and WMI.  This one covers creating a virtual machine from an existing virtual disk – http://dungkhoang.spaces.live.com/blog/cns!31A50D02D661C816!224.entry   Share this post :   Technorati Tags: PowerShell,WMI,Hyper-V

Posted in PowerShell and WMI | Leave a comment

Account management – member of

One of the perennial questions is what groups is this user a member of.  Getting the groups the user is directly a member of is straight forward but getting the groups that those groups are members of is more difficult.  … Continue reading

Posted in PowerShell and Active Directory | Leave a comment

IIS 7 provider

Dmitry has been looking at the IIS 7 provider tech preview.  His comments can be found here – http://dmitrysotnikov.wordpress.com/2008/05/26/iis-7-powershell-rant/ I must admit to finding myself in two minds about the IIS provider.  I tested it when it first became available … Continue reading

Posted in Powershell | Leave a comment

PowerShell and SQL Server 2008 article

There is a new article of mine on Microsoft’s Industry Insiders blog – An Introduction to PowerShell for SQL Server 2008 – http://blogs.technet.com/industry_insiders/archive/2008/05/27/an-introduction-to-powershell-for-sql-server-2008.aspx   Share this post :   Technorati Tags: PowerShell,SQL Server

Posted in PowerShell and SQL Server | Leave a comment

Account management – group membership

Having created our group – http://richardsiddaway.spaces.live.com/blog/cns!43CFA46A74CF3E96!1360.entry – its time to add some members to it ## add the assemblyAdd-Type -AssemblyName System.DirectoryServices.AccountManagement ## create the context i.e. connect to the domain$ctype = [System.DirectoryServices.AccountManagement.ContextType]::Domain$context = New-Object -TypeName System.DirectoryServices.AccountManagement.PrincipalContext -ArgumentList $ctype, "manticore.org", "OU=AMTest,DC=Manticore,DC=org" … Continue reading

Posted in Powershell | Leave a comment

Account management – creating groups

Continuing our exploration of System.DirectoryServices.AccountManagement we will turn our attention to creating a group.  This is very similar (but simpler) to the way we created a user http://richardsiddaway.spaces.live.com/blog/cns!43CFA46A74CF3E96!1358.entry ## add the assemblyAdd-Type -AssemblyName System.DirectoryServices.AccountManagement ## create the context i.e. connect … Continue reading

Posted in PowerShell and Active Directory | Leave a comment

cmdlets or scripts

My last post about creating AD user accounts using the new .NET 3.5 namespace System.DirectoryServices.AccountManagement started me thinking about writing PowerShell scripts as compared to using cmdlets.  In the AD arena there are no Microsoft provided cmdlets for working with … Continue reading

Posted in Powershell | Leave a comment