PowerShell Help Reader

Alexei Martseniuk (one of the developers on the original PowerGUI team) has developed a nice little PowerShell utility – WPF-based PowerShell Help Reader.

It makes searching and using the PowerShell help system easier and just a more pleasant experience. You can see a demo, download a 21-day trial version or buy full version here.

New PowerShell MVPs

Two prominent members of the PowerShell community got Microsoft’s Most Valuable Professional (MVP) award yesterday:

Jaykul

Joel “Jaykul” Bennett – the creator of the PowerBoots UI library for PowerShell and PoshCode.org – the online script repository behind PowerGUI’s Online Search.

JonathanNoble

Jonathan Noble – a very active member of UK PowerShell Usergroup and TechNet UK IT Professional Community Council, and also one of the co-creators of TweeterTags.com

MVP award is extremely valuable in the Microsoft world. It is only granted to the individuals who are actively helping the community and are pushing the boundaries of the technology.

And the award is granted for just one year – to keep you motivated if you want to be re-awarded. ;) Speaking of which quite a few PowerShell folks got re-awarded yesterday as well (naming just those who I know got the award – there are a lot more):

You can find full list of PowerShell MVPs and more information on each of them (luckily I can say “us” ;) ) here.

Congratulations to Joel and Jonathan, and everyone who got re-awarded!

Tags: ,

Build Org Charts with PowerShell

Kirk has recently published his Org Chart PowerPack which frankly I myself have been using a lot lately.

For anyone working in a medium to large size of company this is just a great tool to navigate your organization and even produce html and Visio reports about it:

Does your HR have anything like that? Send them the link to the demo and get them addicted to PowerShell!

Read more about the PowerPack in Kirk’s blog.

Tags: , , , , , , ,

Prevent desktop lock or screensaver with PowerShell

Imagine that there’s a webcast that you absolutely need to record and your girlfriend calls because she had a bad dream and you need to go to give her consolation, or it’s your daughter’s birthday, or simply 11 pm because the Earth is huge and the timezones suck. Your first reaction is to simply try to record the webcast but this is a corporate PC and group policy is configured to lock the desktop after x minutes of inactivity. What do you do?

I found myself in this situation a few days ago, and did not want to search the internet and download a random executable simulating user activity and doing who knows what else on my computer.

Instead I wrote this simple PowerShell script:

param($minutes = 60)

$myshell = New-Object -com "Wscript.Shell"

for ($i = 0; $i -lt $minutes; $i++) {
  Start-Sleep -Seconds 60
  $myshell.sendkeys(".")
}

All the script does is creates a Windows scripting shell com object, and then for the specified number of minutes (which is a script parameter) every minute presses the “.” key.

Then I saved the script as Prevent-Screensaver.ps1 file (”prevent” is not a proper PowerShell verb, but disable- or stop- do not seem quite right…) and started it from PowerShell command-line: & c:\Prevent-Screensaver.ps1 120

One other thing which I also did was starting a notepad and clicking into it. This made the script output the dots into the application rather than overload Windows input buffer (which would have caused the OS to start beeping.)

Oh, and before anyone adds comments on how I have just ruined desktop security in the enterprise… By using this you might be circumventing security measures which your company might have for a reason. Check with your HR/IT/legal department/manager when in doubt. ;)

Tags: ,

Exchange 14 PowerGUI wallpaper

Oz (Exchange MVP doing a great series of Exchange/PowerShell/PowerGUI How-To’s) has also posted a bunch of Exchange 2010 desktop wallpapers – one of them featuring PowerGUI.

Download them here.

Tags: , , ,

Add great HTML reports to PowerGUI

Kirk has recently published a PowerPack which adds really nice-looking reports to PowerGUI Admin Console. Once you install the pack you will get these reports for any systems you manage: AD, Exchange, Operations Manager, VMware, Hyper-V – you name it.

See this video for details:

Download the PowerPack here.

Tags: , , , , ,

3 cmdlets a day keep the trouble away

There’s yet another reason to follow @PowerGUIorg on Twitter.

Our friendly community site ghost now 3 times a day tweets a random PowerShell cmdlet with the cmdlet name, synopsis, and link to the cmdlet page which has detailed cmdlet information: full description, parameters, examples, and so on.

sample-powershell-tweet

This should be a great way to learn cmdlets shipped with PowerShell v2 (some are obviously present in v1 as well) in small easy chunks. :)

@PowerGUIorg also tweets each time a new discussion is started at PowerGUI.org forums – so you can easily get involved in any topic which you find interesting or perhaps help somebody out if you know the answer.

Follow @PowerGUIorg and let us know what you think. Any ideas on making this feed even more useful are welcome!

Tags: , , ,

Video: What’s new in PowerGUI 1.8

For those preferring seeing to reading here’s Darin’s video highlighting the major improvements introduced in PowerGUI Admin Console in version 1.8:

If you want to learn more, I also had a few blog posts on 1.8 features on my blog:

Tags: , , ,

AD Recovery from PowerShell

Want to roll back any Active Directory change with a PowerShell one-liner? We’ve just published an online reference to the cmdlets shipped with Quest Recovery manager for Active Directory.

These cmdlets use backups so they are not limited to tombstone reanimation (as regular cmdlets).

For example, if you restore a user you get all the attributes including group membership and so on.

So to restore a deleted object you simply call Restore-RMDeletedActiveDirectoryObject and have the tool handle everything.

However, what makes it way more cool is that you have full power to restore any attributes of any users. So you are not limited to just undeleting stuff. Let’s say you had some kind of script/tool go wild and corrupt an attribute or two across all user accounts. Good luck restoring just these 2 attributes manually or with any kind of UI tool.

With these cmdlets it is as easy as:

# Select the backup you want - e.g. the latest
$b = (Get-RMBackup –Domain dom1.local | Sort-Object –Property Date)[-1]

# For every user in AD restore extensionattribute1

Get-QADUser | foreach {
Restore-RMActiveDirectoryObject –Backup $b.Path –Object $_.DN –Attribute extensionattribute1
}

Is it cool or what? ;)

Here’s the full list of cmdlets linked to the help info for each of them:

Note that unlike AD cmdlets these are actually a part of commercial product so there is cost involved. You can get a trial license from the product page. If you are a Microsoft MVP you can also get a free NFR license by applying here.

(Get-RMDeletedActiveDirectoryObject dc1.dom1.lab.local) | Where-Object { $_.Properties["objectclass"] –contains "user" }

C:\PS>foreach ($u in $users) { Restore-RMDeletedActiveDirectoryObject –Name $u.Properties["name"] –DirectoryHost dc1.dom1.lab.local }

Tags: , , , , , , ,

Add your code snippets to PowerGUI

Want to add your PowerShell code snippets to PowerGUI Script Editor?

snippet_insert

It is actually as easy as adding your xml .snippet file to the C:\Program Files\PowerGUI\snippets folder.

You can create a new file manually or use any Visual Studio-compatible snippet editor. I am using Snipp Dogg which is a free open source project on codeplex. So my instructions below are using this tool but anything else would do.

1. Run the tool as Administrator (or it would not be able to save to Program Files if you are on Vista or later.)

2. You can see and study any of the snippet files shipped with PowerGUI:

PowerShell_Snippets

3. Click the New button to create a new snippet and then paste your code into the central pane – in my example I start with advanced function code from PowerShell v2 example:

new_snippet

4. If you want your snippet to have placeholders for certain variable names, parameters, and so on, you need to replace each of them with $some_kind_of_id$. In addition to that you can put $selected$ in front of the one you want to become selected once the snippet is inserted.

In my example, I am making the function name and the variable name these snippet parameters (in snippet lingo “literals”) and make the function name selected by default:

params

5. Fill out other snippet parameters in the right-hand pane (Snipp Dogg does not have powershell as a language option – shame on them – so either change it in the xml file later on or just leave it as csharp – PowerGUI does not check this field):

sniippet_description

6. Expand the Literals collection and click New to add a new literal (remember: we need to specify two):

snippet_new_literal

7. Fill out and save (by clicking OK) both functionname and param:

function_name_literal

snippet_param_paramname

8. Save the snippet to the C:\Program Files\PowerGUI\snippets folder (requires admin rights in Vista and later):

snippet_save

9. Start PowerGUI Script Editor and insert the snippet:

snippet_insert

snippet_inserted

That’s it! Happy scripting! ;)

Tags: , , ,

Next Page »


View Dmitry Sotnikov's profile on LinkedIn

Follow Dmitry Sotnikov at Twitter

My Recent Tweets

Archives

See you at:

Legal

The posts on this blog are provided “as is” with no warranties and confer no rights. The opinions expressed on this site are mine and mine alone, and do not necessarily represent those of my employer Quest Software or anyone else for that matter. All trademarks acknowledged.

© 2007 Dmitry Sotnikov

Pages

 

July 2009
M T W T F S S
« Jun    
 12345
6789101112
13141516171819
20212223242526
2728293031