Monthly Archives: April 2009

How many bytes?

I was playing around with PowerShell and started thinking about the kb, mb etc values and I realised I didn’t know what they really looked like.  1kb is 1024 but it gets very hazy after that. So how could I … Continue reading

Posted in PowerShell V2 | Leave a comment

Creating a process

I’ve looked at creating a process before – using [WMIClass].   With CTP3 we have a few more options   Start-Process -Filepath notepad.exe   Invoke-WMIMethod -Class Win32_process -Name Create -ArgumentList notepad.exe   Set-WMIinstance -Class Win32_process -Arguments @{Path=c:windowssystem32notepad.exe}   The first … Continue reading

Posted in PowerShell and WMI | 2 Comments

PowerShell verbs

If you haven’t seen the post on PowerShell standard verbs from the PowerShell team it is worth reading – http://blogs.msdn.com/powershell/archive/2009/04/22/soliciting-new-verbs.aspx   If you have an idea for a new verb – make sure you make it known

Posted in PowerShell V2 | Leave a comment

PowerShell remoting options

One of the big pieces of functionality in PowerShell v2 is the ability to directly administer remote machines.  A number of cmdlets get a computername parameter for working directly. The main push for remoting is through the *-PSsession cmdlets Enter-PSSessionExit-PSSessionExport-PSSessionGet-PSSessionImport-PSSessionNew-PSSessionRemove-PSSession … Continue reading

Posted in PowerShell V2 | Leave a comment

Too ambitious?

Been looking at Exchange 2010.  It installed OK on Windows 2008 R2 Beta and seemed to run OK.  I have come across a few issues: Exchange Management Console doesn’t start properly and doesn’t run properly The new Remote PowerShell functionality … Continue reading

Posted in Powershell | 3 Comments

AD attributes

I had a question come through as a private message regarding how to extract a particular attribute for user objects. The script wasn’t working because the label name in AD Users and Computers didn’t match the attribute name. This is … Continue reading

Posted in PowerShell and Active Directory | 1 Comment

Sorting

Sorting is a fairly common activity in PowerShell.  One scenario I don’t see very often is a requirement to sort in two different directions.  I have a list of users and their last logon dates – I want to sort … Continue reading

Posted in Powershell | 1 Comment

User Module – local account

Back in February – http://richardsiddaway.spaces.live.com/blog/cns!43CFA46A74CF3E96!2099.entry – I showed a module I had created to generate a new password.  Its time to return to that module.  I am going to expand it to work with local user accounts. Then I’ll add … Continue reading

Posted in PowerShell V2 | Leave a comment

Forest and domain modes

We can find the forest and domain modes using the following commands Get-ADDomain -Identity grayson | select DomainMode Get-ADForest grayson | select forestmode The modes can be set from the GUI as normal or Set-ADDomainMode -Identity grayson -DomainMode Windows2008R2DomainSet-ADForestMode -Identity … Continue reading

Posted in PowerShell and Active Directory | Leave a comment

Two PowerShells

Windows Server 2008 R2 is 64 bit only so we we get two instances of PowerShell and ISE.  One (64bit version) is just labelled Windows PowerShell V2 and Windows PowerShell V2 ISE.  The 32bit version has (x86) appended to the … Continue reading

Posted in PowerShell V2 | Leave a comment