powershellscripts.com

PowerShell Logo


97 results found for the Operating System Category in about 0.017 seconds
Access 64bit registry values from 32bit powershell
When using the a 32bit powershell to access the registry on a 64bit machine it will fail to access certain registry keys because of registry redirection to the Wow6432Node location.
http://gallery.technet.microsoft.com/6062bbfc-53bf-4f92-994d-08f18c8324c0

Change StartMode of a Service
This script uses WMI to change the start mode of a service.
http://gallery.technet.microsoft.com/6d0f06ed-f840-4228-ad2d-e16ebe6a3aed

Compare-Hotfixes
Script to generate a HTML Hotfix Comparison Table on a set of computers
http://gallery.technet.microsoft.com/178249bf-6d7f-4137-b473-e9351607163f

Compare-InstalledHotfix
This script takes two servers and will tell you the delta of patches between the two servers.
http://gallery.technet.microsoft.com/b01c1fab-b16b-4784-9249-63d3488b70b7

ConvertFrom-DateString

http://gallery.technet.microsoft.com/5b40075b-caef-45e8-8b12-d882fcd0dd9c

Create or Modify registry key values remotely
Did you ever wanted to modify your registry or add a key/value pair to registry? Wished there was a script to help you do that? Even better, wished it can run remotely without PowerShell WinRM listener configured on target server?I had custom script that would modify certain regi
http://gallery.technet.microsoft.com/Create-or-Modify-registry-c752668c

Determine OS and Service Pack Level Across Network

http://gallery.technet.microsoft.com/777dd93a-9ee2-42a8-9cef-ac698a0436b2

Determine OS and Service Pack Version
This PowerShell script reads a list of computers specified in a text file and outputs the Operating System Name and the Service Pack version Information to an excel spreadsheet in a tabular form.
http://gallery.technet.microsoft.com/0592f4f0-629f-42c7-a985-2da6a081a6fe

Determine OS type,version and service pack using AD information
Getting OS type , build number and service pack version from active directory
http://gallery.technet.microsoft.com/c79e9809-b8e8-4cf1-af07-27a0e5ac384e

Edit $ENV:Path in Powershell
Edit the System PATH statement globally in Windows Powershell with 4 new Advanced functions. Add-path, Set-path, Remove-path, Get-path - SUPPORTS -whatif parameter
http://gallery.technet.microsoft.com/3aa9d51a-44af-4d2a-aa44-6ea541a9f721

Enable RDP Registry Setting
This script takes a listing of servers in a text file and set the fDenyTSConnections Registry setting to 0 to allow for remote connections.
http://gallery.technet.microsoft.com/60c75dfc-7912-469c-b761-593f90ec89f8

Export Windows performance counter descriptions to CSV
This script queries the Windows performance counters on the local computer and exports the object names, counter names, and counter descriptions to a CSV file for easy reference.
http://gallery.technet.microsoft.com/4d0fb6bb-57f1-4137-9246-ad98cc90b0cf

Find Web pages stored in ZIP/RAR files.

http://gallery.technet.microsoft.com/Find-Web-pages-stored-in-e2e7f4b7

Get counter information from local or remote systems

http://gallery.technet.microsoft.com/9ea8cd6e-0371-47ec-8e07-cdb9f683e08b

Get Operating System Version
Uses the Win32_OperatingSystem WMI class to determine the version of Windows in use.
http://gallery.technet.microsoft.com/6e1b6724-3674-4487-b544-2706bfe0b0b5

Get System Install Date
Gets the system installation date. The script accepts input from the pipeline.
http://gallery.technet.microsoft.com/d38a02b5-d85f-4e69-b7d4-1edd84bc6239

Get System Last Boot Up Time
This script uses WMI to get a system last boot up time. It accepts input from the pipeline.
http://gallery.technet.microsoft.com/1918777c-1915-406f-8193-3febb6012d3c

Get Windows Experience Index
This function allows you to gather the Windows Experience Index values from local or remote computers.
http://gallery.technet.microsoft.com/2b5af6d6-79e3-4a54-92cc-2214c17c9e95

Get-ArrayList2.ps1
Demonstrates using the System.Collections.Arraylist object
http://gallery.technet.microsoft.com/ab9d6bba-484b-4823-b945-8bb0ec4f401e

Get-ColourRGB.ps1
This script demonstrates how to use the Windows colour dialog from PowerShell.
http://gallery.technet.microsoft.com/7598c6c8-9a08-4845-a4d5-408fb21bf2a4

Get-Cultures.ps1
Gets the cultures on a system and displays them. This script re-implements an MSDN sample using PowerShell.
http://gallery.technet.microsoft.com/9e019f2f-93b5-40e0-8431-b571c8b012c3

Get-DllInfo
Inspects all the DLLs in a path recursively and tells you what architecture they were compiled for. If they are unmanaged DLLs it will inform you that they are native binaries.
http://gallery.technet.microsoft.com/1716d013-79bc-4f0a-85eb-6062a1905225

Get-DSTInfo - Determine Time Change Information With A Function - Outputs Object
The Get-DSTInfo function will check when a computer is scheduled for Daylight/Standard time changes.  It uses the WMI Win32_TimeZone and Win32_LocalTime class to poll the required information.    
http://gallery.technet.microsoft.com/Get-DSTInfo-Determine-Time-8f7f9f91

Get-HostEntry2.ps1
Demonstrates GetHost Entry method of System.Net.Dns class
http://gallery.technet.microsoft.com/16a540a3-68ad-4457-840e-6b4043c1d547

Get-Hotfix with multiple options and e-mail report (Powershell)
This uses get-hotfix to pull information from a single server, or multiple manually entered servers or a txt file containing the server names. Also provide the hotfix information in .txt and .html saved to your local hard drive and e-mails the above files to you as well.
http://gallery.technet.microsoft.com/21361109-9659-42dd-941e-90afbac334b1

Get-LoopBack.ps1
This script checks to see if the passsed string is either an IPv4 or IPv6 loopback address and if so, displays details.
http://gallery.technet.microsoft.com/35844e76-90a8-49de-8154-98a6a93c3495

Get-PersianCalendar.ps1
Demonstrates the use of the Persian Calendar object in the System.Globalization namespace.
http://gallery.technet.microsoft.com/62f3b96b-1f15-4459-9055-805677c958fc

Get-PKICertificates
This advanced function allows you to query remote and local machines for their certificates and also report back which ones are expired or expiring.
http://gallery.technet.microsoft.com/a2a500e5-1dd2-4898-9721-ed677399679c

Get-ServiceAccountUsage

http://gallery.technet.microsoft.com/Get-ServiceAccountUsage-b2fa966f

get-services
Script for getting information about services running on multiple computers.
http://gallery.technet.microsoft.com/1f808f82-a78c-4846-9bb8-b5ad72e1c06f

Get-UmAlQuraCalendar.ps1
Demonstrates the Um Al Qura calendar.
http://gallery.technet.microsoft.com/ed3cb076-9c97-446a-8bdd-049ae967b1aa

Get-VirtualMachine.ps1
This script gets a list of VMs running on a Hyper-V Host
http://gallery.technet.microsoft.com/f950ca1b-8618-4ac6-97d3-5f881c055e91

Get-WMINameSpace
This script obtains the names of all the namespaces on a computer.
http://gallery.technet.microsoft.com/890ff802-9db2-4d25-aa13-4a2b22fe5db3

Getting & Setting Page File & Memory dump (Manual / Automated)
This script will help us to get & set Page File & Memory dump (Manual / Automated).
http://gallery.technet.microsoft.com/cd996579-2471-4dfc-b1d4-3167ebc7b15d

hardware and software inventory Collection From AD or Txtfile into Excel sheet
the script takes a number of servers as an input and produces custom objects with certian properties like (name , rams , cpu , installed applications ...) which can be pipelined to export-csv to produce an excel readable file
http://gallery.technet.microsoft.com/bab75d1d-76c8-4d0d-8ef9-710f59aaffed

Hyper-V Certificate Validation Workaround
If certificate verification delays are causing long VM start up time, run this script to set up a workaround using Hyper-V registry key for certificate validation. This should allow faster VM start when experiencing network issues that delay validation.
http://gallery.technet.microsoft.com/5b4a7114-218b-466c-a9c1-7eb2f725e707

Identify the Version of DirectX Installed on a Computer

http://gallery.technet.microsoft.com/c79edfcd-6762-4fea-9344-c555ac3fc591

Invoke Best Practices Analyzer on remote computers
Script to invoke Best Practices Analyzer on remote computers.
http://gallery.technet.microsoft.com/84d3e608-1404-4ee9-b5e2-24452ecc8b94

List certificates by days until expiration
PowerShell one-liner to show unexpired certs by number of days until they expire.
http://gallery.technet.microsoft.com/a4760914-cf72-4505-97d3-94166c7d3521

List Classic COM Class Settings
Returns configuration information for the “classic” COM classes installed on a computer. This script requires both Windows PowerShell and the corresponding version of the .NET Fr
http://gallery.technet.microsoft.com/d800ab24-1cfa-402c-a2dc-4695b035a175

List Classic COM Classes
Retrieves information about all the “classic” COM classes installed on a computer. This script requires both Windows PowerShell and the corresponding version of the .NET Framewor
http://gallery.technet.microsoft.com/9b7e6b69-0e52-4d81-9c13-b096977d4a22

List Component Categories
Retrieves information about the COM class component categories (COM classes that share common functionalities) found on a computer. This script requires both Windows PowerShell a
http://gallery.technet.microsoft.com/dcf14a6a-2568-4c43-80d7-0f6ec861fc4a

List Computer System Properties
This code demonstrates how to list Computer System information for the local system without any plug-ins.
http://gallery.technet.microsoft.com/8f50e155-fc67-4934-bff5-a246e6aca42d

List DCOM Application Settings
Returns information about the configuration of each DCOM (distributed COM) application installed on a computer. This script requires both Windows PowerShell and the corresponding
http://gallery.technet.microsoft.com/65e68091-7159-4c8b-8dc3-53d0fe1c08b5

List DCOM Applications
Returns information about all the DCOM (distributed COM) applications installed on a computer. This script requires both Windows PowerShell and the corresponding version of the .
http://gallery.technet.microsoft.com/89a5e3c2-0a1c-4471-b78c-136606cafdfb

List Information about the Threads Active on a Computer
Returns a list of threads and thread states for each process running on a computer. This script requires both Windows PowerShell and the corresponding version of the .NET Framewo
http://gallery.technet.microsoft.com/221eb8f1-d12c-47a2-958d-a457a78d0fa2

List Installed Hot Fixes
Returns a list of all the hot fixes installed on a computer. This script requires both Windows PowerShell and the corresponding version of the .NET Framework. For more informatio
http://gallery.technet.microsoft.com/a14f98f0-8fc8-43bf-837e-32b678f3a362

List Operating System Properties
Retrieves information about the operating system installed on a computer, including language, encryption level, and build number. This script requires both Windows PowerShell and
http://gallery.technet.microsoft.com/5f9c010d-d9fc-44e3-8698-ab222c38fd1d

List Operating System Properties
This code demonstrates how to list Operating System information for the local system without any plug-ins.
http://gallery.technet.microsoft.com/b187d7d8-e8c2-4541-a74b-f7d8f41e0af7

List Page File Properties
Lists the properties of all the page files on a computer. This script requires both Windows PowerShell and the corresponding version of the .NET Framework. For more information o
http://gallery.technet.microsoft.com/f91d0e95-3a2f-4ec8-bc52-2dd1346684ce

List Page File Settings
Returns information about the initial and maximum sizes of all the page files on a computer. This script requires both Windows PowerShell and the corresponding version of the .NE
http://gallery.technet.microsoft.com/605e80fd-a80a-4724-9008-d5c01eebb01a

List Page File Use
Retrieves page file usage statistics. This script requires both Windows PowerShell and the corresponding version of the .NET Framework. For more information on downloading these
http://gallery.technet.microsoft.com/cb503db5-3eed-49aa-bf10-c85431041825

List ProgIDs
Returns a list of ProgIDs (Programmatic Identifiers) found on a computer. This script requires both Windows PowerShell and the corresponding version of the .NET Framework. For mo
http://gallery.technet.microsoft.com/94fa298f-3dd3-4604-a369-bf212342be24

List Registry Properties
Returns information about the computer registry. This script requires both Windows PowerShell and the corresponding version of the .NET Framework. For more information on downloa
http://gallery.technet.microsoft.com/714079a7-3bd1-4fb0-8b2b-2887052b7af5

List Remote Application on Computer
Using Powershell, Query a list of PC's to find all applications installed. Write output to console with computer name and application name
http://gallery.technet.microsoft.com/e4cdcc2c-185a-43d7-9b44-3de15ba7bf34

List Scheduled Tasks
Enumerates all the scheduled tasks on a computer. Note: WMI can only enumerate scheduled tasks created using the Win32_ScheduledJob class or the At.exe utility. It cannot enumerat
http://gallery.technet.microsoft.com/7980c93b-38d6-4c28-93e7-0e8efa7f373f

List Scheduled Tasks That Failed to Run

http://gallery.technet.microsoft.com/8802ab28-6d0a-4795-8acb-e5a84a04606c

List Service Data in a Spreadsheet

http://gallery.technet.microsoft.com/f05e102a-7516-484e-84f5-8ff1e9fa56de

List Service Load Order Groups
Returns a list of all the service load order groups found on a computer, and well as their load order. This script requires both Windows PowerShell and the corresponding version
http://gallery.technet.microsoft.com/a0c1fb91-1fa5-49dc-9940-407326de9d2a

List Service Properties
Retrieves a complete list of services and their associated properties. This script requires both Windows PowerShell and the corresponding version of the .NET Framework. For more
http://gallery.technet.microsoft.com/cf542d23-007d-4737-a36a-b9b9182c2268

List Services where StartMode is AUTOMATIC that are NOT running
This script will list services from a local or remote computer where the StartMode property is set to "Automatic" and where the state is different from RUNNING (so mostly where the state is NOT RUNNING)
http://gallery.technet.microsoft.com/dba0a313-5a74-464a-a98a-fac57ed28105

List the Local Time on a Computer
Returns information about the local time configured on a computer. This script requires both Windows PowerShell and the corresponding version of the .NET Framework. For more info
http://gallery.technet.microsoft.com/a4c23a64-c460-42fb-8b1b-19b805451b5f

List the Processes Running on a Computer
Returns information about all the processes running on a computer. This script requires both Windows PowerShell and the corresponding version of the .NET Framework. For more info
http://gallery.technet.microsoft.com/e75ea53a-4773-42a7-b0f8-ce8b43b66d17

List the UTC Time on a Computer
Reports the Universal Time Coordinate (UTC) time on a computer. This script requires both Windows PowerShell and the corresponding version of the .NET Framework. For more informa
http://gallery.technet.microsoft.com/923fd8ee-cb8d-4e08-9014-1eea08aa14f1

List Time Zone Information for a Computer
Retrieve information about the time zone configured on a computer. This script requires both Windows PowerShell and the corresponding version of the .NET Framework. For more info
http://gallery.technet.microsoft.com/5eb44c9c-12c0-4562-9475-fb94810adb4d

Monitor Failover Cluster Health
Once I needed to keep a close eye to a File Cluster however at this particular time no proper Monitoring Solution was in place so I decided to write my own "Poor Man's Montitoring Solution" observing the items I was interested in.
http://gallery.technet.microsoft.com/Monitor-Failover-Cluster-02c56808

Non-responsive Safe System Shutdown
Safely shuts down your computer, rather than a un-expected reboot.
http://gallery.technet.microsoft.com/7516cfa0-bfff-4355-b739-94d179f14967

Percent Uptime Calculator
This script calculates the real percent uptime for a server, it does not just return the amount of time since last reboot.
http://gallery.technet.microsoft.com/True-Uptime-Calculator-5903cf22

Performance Monitoring with config file build that writes to SQL database
This script it used to gather performance data and upload it to SQL. An option to build an XML config file that can be ran against the script to decide what counters to use.
http://gallery.technet.microsoft.com/bf5fff64-1be1-4cd8-bd2e-2ef335d958c3

Ping Computers Using Windows PowerShell

http://gallery.technet.microsoft.com/5279ee40-8ca2-4e20-bf10-34b948b940c6

Powershell Measure-PerfLog function
This Powershell function will summarize performance logs generated by Windows Performance Logs and Alerts. It uses the Powershell Import-Counter cmdlet.  Using the raw data, Measure-PerfLog will summarize the data by performance counter, and can be easily exported to CSV.
http://gallery.technet.microsoft.com/Powershell-Summarize-95576d3f

PowerShell Script Remove-StartupItems.ps1
Enumerate items in Startup locations, checks for original file name then, if changed remove item, checks against custom safe list and safe vendor list. If not in either safe list, remove item.
http://gallery.technet.microsoft.com/55d79222-8da4-4e63-a4fa-791ddbfb5285

PowerShell WMI Permanent Events
Here is an eventing demo. It will be updated as I fix and add documentaion.  Check back.  
http://gallery.technet.microsoft.com/PowerShell-WMI-Permanent-7e17f262

ProductType
Will show the ProductType
http://gallery.technet.microsoft.com/6b44521d-8c25-4990-8276-044d8ff3f0b8

PS- Get status report of one or more hotfixes from one or more computers
This script searches for the installation status of one or more hotfixes. You can supply the hotfixes from command line, or type them into the script. It will read a text file for comptuer names, or you can type them from the PS line when you run it. It will write to a log file.
http://gallery.technet.microsoft.com/6b00293b-e569-4fc5-bd48-83ff544b30de

PS- WMI Query that returns Service 'State' on a group of devices
Creates a list of devices from Active Directory and queries each device that responds with ping reply for a specific service running. Outputs Status of Service for each device.
http://gallery.technet.microsoft.com/0f1ab629-d463-4406-be54-ec2c4c23bc1f

Rebooting a Server
This is a simple script to reboot a server.
http://gallery.technet.microsoft.com/c41add90-ac61-45af-a3f9-2ee98e38f116

Registry Security PowerShell Module
Allows a much easier management of permissions inside the registry database using PowerShell
http://gallery.technet.microsoft.com/ce4c51a1-43df-42df-bbd1-c2ad0249a864

Remotely execute cmd.exe commands on multiple computers
This script invokes whatever command you can use in cmd.exe on one or more computers remotely like {del , netstart , ipconfig /flushdns}
http://gallery.technet.microsoft.com/56962f03-0243-4c83-8cdd-88c37898ccc4

Remove-FtpFile.ps1
This script removes a file on a FTP Server.
http://gallery.technet.microsoft.com/9306f866-9045-4046-9410-78dea3fbcafc

Remove-Service.ps1
Removes a hypothetical service
http://gallery.technet.microsoft.com/cc751124-8b1e-48ff-b1e5-d970d5e227d5

Removing old diff files from a backup disk location
This script will remove old differential backup images from a disk location leaving only the base images.
http://gallery.technet.microsoft.com/f6387491-e7bd-47b0-9a53-3c90531c4756

Scan PowerShell Installation and Version
This script receives a list of computers from a text file and then scans each one to determine if PowerShell is installed. If it is, the script then determines whether it is PowerShell 1.0 or 2.0. The script then returns the results to the screen.
http://gallery.technet.microsoft.com/Scan-PowerShell-Installatio-366fe236

Script to migrate scheduled tasks from Windows XP/Server 2003 to 7/Server 2008
Based on http://www.digitalforensics.be/blog/?p=205Script to migrate scheduled tasks from Windows XP/2003 to Windows 7/2008 task scheduler. Provides an alternative,if running "schtasks /query /s" from the Win 7 machine connecting to the XP machine remotely is not an option.
http://gallery.technet.microsoft.com/Script-to-migrate-e4e5ea20

Send files to Compressed Zipped Folder
Conversion of VB.Net Function written by Steve Fulton to send files / folders to compressed zipped folder in Windows
http://gallery.technet.microsoft.com/e093e2d0-672b-402b-a33f-568610cc4bb7

Set SEHOP flags (DisableExceptionChainValidation) in registry
Set SEHOP flags (DisableExceptionChainValidation) in registry, both the system-wide flag and the per-process IFEO flags.
http://gallery.technet.microsoft.com/1b4a3d59-d8ea-4d14-b512-8fab74710584

Set-RemoteService
Sets service state for remote machines, single and from a list. start/stop/restart with a clean exportable format.
http://gallery.technet.microsoft.com/79595ce9-bfc3-463e-9e84-d9e0b78590c1

Set-TimeZone function (PowerShell)
Set the system time zone with a simple function.
http://gallery.technet.microsoft.com/Set-TimeZone-function-b5ed93b5

Show Installed Windows Roles and Features
PowerShell one-liner to show which Windows roles and features are currently installed.
http://gallery.technet.microsoft.com/2592d8e7-f830-4d64-bce8-fb4f79ddc66c

Start AutoStart Services that have Stopped
Restarts any auto-start services that have been stopped.
http://gallery.technet.microsoft.com/2a76d453-1649-4561-8844-5601b0700c1e

Start Services on Remote Computer
This script will start Automatic services on a remote server that have either failed to start or have stopped. It's specifically looking for Exchange 2010 services, but the code can be easily adjusted for any services. Assumes WS-MAN and PowerShell v2.
http://gallery.technet.microsoft.com/29b55067-10e0-45ea-b394-2ee4884d6711

Start, Stop, Enable, Disable Services Remotely - Updated Script
I have updated one of old Powershell scripts (http://portal.sivarajan.com/2010/07/stopstart-or-enabledisable-service.html) based on a comment posted on my blog.
http://gallery.technet.microsoft.com/b49b98d4-5162-492d-98fd-5a92a4dcd953

Stop, Start, Enable or Disable Service

http://gallery.technet.microsoft.com/212e68f0-5279-4499-8e9e-6aa1807719c0

Terminate running process on multiple servers
this script terminates a process running on a single or multiple computersnusing WMI class Win32_process
http://gallery.technet.microsoft.com/698c2512-2bbd-40ee-b3bf-a9cebdad2faf

Use WPF UI Automation to Browse Windows UI Elements
The script uses .Net Framework and System.Windows.Automation classes to browse Windows UI elements hierarchy.
http://gallery.technet.microsoft.com/231c68f5-70a5-42a3-88d9-d382e756c7b0

View Scheduled Jobs and report Status with notification
This script can run against a local or remote machine/s and can list all or only the failed jobs. An optional email notification can be sent out too when jobs have failed.
http://gallery.technet.microsoft.com/317e626a-9578-4c36-92da-d17b458a4e30

View Scheduled Tasks on Remote Computers
At times it is necessary to update passwords on service accounts or make other changes and it is hard to keep track of where that service account has been used.  One of the places that they are often used is in Scheduled Tasks.  This script allows you to query a computer for sche
http://gallery.technet.microsoft.com/View-Scheduled-Tasks-on-f10febd8