Your basic ITPro blog... What's going on at work, what I'm interested in.

Tuesday, March 18, 2008

2008-03-18 PowerShell Exercise

I almost didn't bother with this one... There is really no difference between The Scripting Guys' solution and the PowerShell solution. In their article, they talk about how the MS Office Suite stores, displays, and edits this information. Because each Office App does these three things differently (who writes this stuff?!), we have to use Word to retrieve this information, rather than PowerPoint. Gotta love Microsoft!

THE QUESTION:

In PowerPoint user information is stored under the Tools menu. I would like to know if there is a way to extract this data by using a script.

THE SCRIPTING GUYS ANSWER:

Set objWord = CreateObject("Word.Application")
Wscript.Echo "Name: " & objWord.UserName
Wscript.Echo "Initials: " & objWord.UserInitials
objWord.Quit

MY POWERSHELL ANSWER:

$word = New-Object -ComObject Word.Application
$word.UserName
$word.UserInitials
$word = $null

No comments:

Additional Info

My photo
email: support (AT) mangrumtech (DOT) com
mobile: 480-270-4332