posted
17/02/10
By Fredrik Wall
I currently working with clients in an environment
without any system that will update computers
Bios automatically.
So I have started to write a PowerShell script for this.
It uses Windows Forms for the output and WMI for
the information gathering.
This script is very similar to Dells VBScript for Bios Upgrades.
That script can be found here.
My script will check for current version on the computer and
then check in a file structure for the right bios upgrade version
and If It needs to be upgraded It will run the upgrade file.
My file structure is very simple and It’s located on a file share.
The bios upgrade files for Dell computers can be found
at ftp.dell.com/bios
The script is in a alpha or Beta phase, but If you are interested
in It you can mail me, DM me on Twitter or send me a message at
messenger.
Technorati Tags:
PowerShell,
GUI,
WMI,
Bios
posted
28/01/10
By Fredrik Wall
Working with a login script for my lab active directory.
100% PowerShell using .NET classes and WMI.
This is VBScript login scripts with HTA on steroids
The GUI part was done in 10-15 min with Primal Forms.
posted
03/01/10
By Fredrik Wall
This is another function that I use in
Active Directory scripting.

I use it when I want to create computer names
with the syntax SitenameComputertypeNumbers.
The function can be found here.
posted
03/01/10
By Fredrik Wall
I’m working on lots of Active Directory functions at the moment.
For a larger Active Directory script.
And one of the functions will get the computer type in clear text.
What does this have to do with Active Directory management do
ask your self right now
Lots of, do I say!
If you need your computers to be named like sitenamecomputertype0001
then this function will do a lot for you.

Just do like this:
$compType = Get-ComputerType -computerName $computerName
$compType = $compType.substring(0,1)
And you got an D a M or a W.
The function can be found here.
posted
29/12/09
By Fredrik Wall
I have made a function for my friend Anders Bengtsson
that will do a Shutdown, Reboot or Log Off.
The function uses Win32Shutdown in the WMI object Win32_Operatingsystem.

Example:
Shutdown-Computer mysrv01 ‘Log Off’
or
Shutdown-Computer mysrv01 ‘Log Off’ other
The other option will open a credential form and then uses your input for credential.
The script can be found here.
posted
05/08/09
By Fredrik Wall
When working with installation systems or other Network systems
you often need your users MAC Address.
You can ask the users to start cmd.exe and then do a ipconfig.exe /all.
If you have 100-5000 users this can be a whole year of work
Or you can open up powershell and use this little script:
$strComputer = "."
$colItems = get-wmiobject -class "Win32_NetworkAdapterConfiguration" -computername $strComputer |Where{$_.IpEnabled -Match "True"}
foreach ($objItem in $colItems) {
$objItem |select Description,MACAddress
}
Combine this script with a Active Directory script that will show all of your
computers and then Export it to a csv file and you have a good import file!
posted
27/02/09
By Fredrik Wall
I have made a little screencast without sound that shows how easy It is to get information about the Operating System by using WMI.

Get more information at:
win32_operatingsystem class information
http://msdn.microsoft.com/en-us/library/aa394239.aspx
posted
27/02/09
By Fredrik Wall
Almost the same as the last post. But this time we have It as a function.

Technorati-taggar:
PowerShell,
WMI
Andra (Bloggar.se) skriver om:
PowerShell,
WMI