Category Archives: Windows Scripts

Sample Script to manage Windows

Windows: Read the IP Address of a BMC Board

Most of the Serversystems have a Baseboard Management Controller (BMC) integrated for maintenace and management tasks.

Typical functions are, indepentend from the running operating system:

  • Shutdown and reboot
  • Switch Power On and Off
  • KVM (Keyboard, Video, Mouse) redirection
  • Hardware monitoring
  • USB redirection, connect the local DVD Drive to the Server over a LAN connection
  • and much more…

Usually, the BMC has its own LAN Interface and therefore an own IP Address.
Continue reading Windows: Read the IP Address of a BMC Board

Advertisment to support michlstechblog.info

Powershell: Active Directory Domain Operations

Hi,

some commands to manage Active Directory Domain Controllers by using the .NET System.DirectoryServices.ActiveDirectory.Domain Class.
Load the assembly

[reflection.assembly]::LoadWithPartialName("System.DirectoryServices.Protocols")|Out-Null

Get a Domain Object with the logon Domain of the current user
Continue reading Powershell: Active Directory Domain Operations

Powershell: How to show a message box

Sometimes while a powershell script is running you want to show a MessageBox with a information or warning to the user. In Windows Powershell no Commandlet exists to show a Message Box.

Nevertheless it is possible by using the .NET Windows.Forms.MessageBox class:-).

First of all load the assembly.

# Load assembly
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")

To show the messagebox call the static function show(“Message Text”)
Continue reading Powershell: How to show a message box

Windows: Disable automatic Window arranging and resizing while dragging with the mouse (AeroSnap)

Sometimes the Windows 7 functionality to automatically arrange or resize a window while dragging is a pain. This feature is called Aero Snap. Here are good news, you can disable the behaviour :-).

Open the Control Panel, go to “Ease of Access center”. If you are there, click “Make the mouse easier to use” and enable “Prevent Windows from being automatically arranged when moved to the edge of the screen”.

Mouse Settings

Continue reading Windows: Disable automatic Window arranging and resizing while dragging with the mouse (AeroSnap)

Windows: Set network parameters from command line by using WMIC.exe

Hi,

you can use wmic.exe  to set some network parameters (and much more, its WMI!!) from command line. Syntax is very hard, but it works :-).

For Example. If you want to disable the DNS registration of all enabled Intel e1000 network adapters.

wmic path Win32_NetworkAdapterConfiguration where (IPEnabled="true" and ServiceName="E1G60") call SetDynamicDNSRegistration False,False

The Filter in the braces is the where condition of wmi “select * from NetworkAdapterConfiguration where IPEnabled=’true’ and ServiceName=’E1G60′ ” statement.  Modify this for your needs. By using WMI queries this is much more flexible than netsh command lines.

Michael