popunder new

https://www.blogger.com/blog/posts/1739890295310631346

Monday, January 28, 2013

Get memory configuration of all vm's on hyper-v server and output totext file

Two line powershell script that gets memory configuration of all vm’s and outputs to text file.  Change path and name of vmmemory.txt to suit your needs.

Works on Server 2012 with powershell 3
 Get-VM | Get-VMMemory | out-file -filepath C:\VMMemory.txt  
C:\VMMemory.txt

Get all vm’s on a hyper-v server and output to text file

This two line PowerShell script will get all vm’s on a hyper-v server and output to text file. Change path and name of vmrunning.txt to suit your needs.

Works on Server 2012 with powershell 3

 Get-VM | Where-Object {$_.State -eq ‘Running’} | out-file -filepath C:VMrunning.txt  
C:VMrunning.txt

Powershell 3 combo installer

These combo installers will update PowerShell to Version 3 on either Windows 7 x86 or Windows 7 x64 / Server 2008 R2

The installer runs silently and installs both the dotNetFx40_Full_x86_x64.exe  and either the Windows6.1-KB2506143-x86.msu or Windows6.1-KB2506143-x64.msu files. When the script  completes a pop-up prompting for a reboot will be displayed.

1-28-2013 2-17-52 AM


After re-booting and launching powershell type get-host to display the version number.

1-28-2013 2-25-39 AM


Download Button5

Wednesday, December 12, 2012

List members of all local groups on a list of computers vbs script

Here is a script that I use to list members of all local groups on a list of computers. It takes a list of computer names and checks the group members on each one then writes the results to a second file. Change the file paths in lines 6,18 and 33 to match your environment. When its complete it will open the text file with the enumerated computers.

 Const ForAppending = 8  
Const ForReading = 1
ServerCount = 0
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile _
("c:\scripts\serverlist.txt", ForReading)
Do Until objTextFile.AtEndOfStream
strNextLine = objTextFile.Readline
strComputer = strNextLine
'WScript.Echo "Processing " & strComputer
ProcessGroups
ServerCount = ServerCount + 1
Loop
'WScript.Echo "Computers Processed " & ServerCount
'WScript.Quit
Sub ProcessGroups
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objLogFile = objFSO.OpenTextFile("c:\scripts\GroupInfo.txt", _
ForAppending, True)
objLogFile.writeline " "
objLogFile.writeline "***************** " & strComputer & " *****************"
Set colGroups = GetObject("WinNT://" & strComputer & "")
colGroups.Filter = Array("group")
For Each objGroup In colGroups
objLogFile.writeline objGroup.Name
For Each objUser in objGroup.Members
objLogFile.writeline vbTab & objUser.Name
Next
Next
objLogFile.Close
End Sub
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "C:\scripts\GroupInfo.txt"

Sunday, November 18, 2012

Windows Explorer MRU (most recently used) search clear powershell script

This one line powershell script will clear the Windows Explorer MRU (most recently used) search list.

The downloaded zip file also includes both the ps1 script and a compiled exe (executable) version of the script for those who want to run it without launching powershell or if you want to place the exe in your windows start-up folder to clear the search entries each time you start windows.  It works on Vista, Windows 7 or windows 8 and server 2008 or 2012. Getting to your startup folder in Windows 8 or Server 2012 requires browsing to the  location below

C:\Users\<User Profile folder name>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

Download Button5

Tuesday, November 13, 2012

Restoring deleted or messed up srv records in Windows Server 2012

There are occasions when you play with things you shouldn’t.  In those cases where you accidentally delete your SRV records it is very easy to get them back.

Go to an administrative command prompt an type nltest /dsregdns

Check the short 60 second video below.



Friday, November 9, 2012

Using Windows PowerShell to convert from a Windows Server 2012 Core installation to a Windows Server 2012 with a GUI installation

When you install Windows Server 2012, you can choose between Server Core Installation and Server with a GUI. The “Server with a GUI” option is the Windows Server 2012 equivalent of the Full installation option available in Windows Server 2008 R2. The “Server Core Installation” option reduces the space required on disk, the potential attack surface, and especially the servicing requirements. You can freely switch between these options at any time., one approach might be to initially install the Server with a GUI option, use the graphical tools to configure the you can freely switch between these options at any time later.

To add the Server with a GUI  to a Server Core from the  windows server core  command prompt  type
start powershell

In PowerShell type
Install-WindowsFeature Server-Gui-Mgmt-Infra,Server-Gui-Shell -Restart

This will start the installation of the gui feature and restart the system when it completes.

Once the system restarts and you login you will be presented with the standard windows server 2012 with the GUI

Check the short video below for a demonstration.