header image

Archive for June, 2013

I did a test tonight and the sound is definitely better over Lync.  The sound wasn’t perfect but was much better than Live Meeting. Actually, seemed usable. The system seems a lot more responsive in terms of client screen refresh. When showing slides the client refreshes very quickly.  Showing code seemed better – not as […]

under: PowerShell User Group

UK PowerShell group

Posted by: | June 25, 2013 | 3 Comments |

As you are probably aware the UK PowerShell group has been very quiet over the last few months. This has been due to my personal circumstances – hopefully now resolved. I want to re-start the group and was wondering what people wanted. When I started the group 6 years ago we were the only PowerShell […]

under: PowerShell User Group

In my last post I showed how to relate find the groups of which a local user is a member. A comment was left asking about the inverse relationship. In this case we can just turn the code round. Get-CimInstance -ClassName Win32_Group | foreach { $users = Get-CimAssociatedInstance -InputObject $psitem ` -ResultClassName Win32_UserAccount | select […]

under: PowerShell and WMI

A question came up on the Powershell.org forum about finding the groups of which  local accounts are members You can get account data using Win32_UserAccount Group information is held in Win32_Group. You can see the relationship between users and groups by dumping the Win32_GroupUser instances. You will see a load of entries like this GroupComponent […]

under: PowerShell and WMI

Touching files

Posted by: | June 24, 2013 | No Comment |

Unix has a command called touch that allows you to set the access time on a file.  PowerShell doesn’t have a direct equivalent but it is very easy to perform the same task: $date = (Get-Date).AddMonths(-2) Get-ChildItem -Path C:\Teszzt2 -Filter f*.txt | Set-ItemProperty -Name LastWriteTime -Value $date -PassThru | Set-ItemProperty -Name LastAccessTime -Value $date -PassThru […]

under: File System, PowerShell original

At powershell.org we publish a monthly email newsletter. As well as PowerShell related news you get a feature article. These articles are only published through the newsletter and are written by acknowledged PowerShell experts. You can subscribe, for free, at http://powershell.org/wp/newsletter/

under: PowerShell original

Clearing Event logs

Posted by: | June 23, 2013 | No Comment |

I needed to clear some event logs on a test machine. Rather than picking and choosing I’ll clear them all Get-EventLog -List | where {($_.Entries).Count -gt 0} | foreach {Clear-EventLog -LogName $_.Log}   The interesting part is the where-object filter in that Entries is a collection of the Entries in the log. If you want […]

under: PowerShell original

I was on a course last week and one attendee uttered words to this affect “I won’t automate – it takes to long to write the code. I’ll keep doing it manually” You may be able to do it faster the first time by performing the task manually. I can guarantee that the second time […]

under: Opinion

I noticed code like this in quite a few entries in for Event 1 Get-ChildItem -path C:\Application\log -Recurse -Filter *.log | Where-Object{$_.LastWriteTime -lt [DateTime]::Now.Subtract([TimeSpan]::FromDays(90))} | ForEach-Object {…} From the title it should be obvious that there’s something I don’t like.  The where-object re-calculates the date to test for EVERY object on the pipeline. That’s not […]

under: PowerShell Basics, PowerShell original, Scripting Games

Chapters 12 and 13 have been added to the Manning Early Access Program Chapter 12 shows you how to manage your domain controllers Chapter 13 teaches how to protect the data in your Active Directory   You can order the MEAP from www.manning.com/siddaway3

under: Active Directory, Books, PowerShell and Active Directory

« Newer Posts - Older Posts »