search
top
Currently Browsing: Powershell

Retrieving Disk Information and Freespace Using PowerShell 2

It is always nice to be able to retrieve disk information for the systems. Alot of scripts are used to gather the information so Administrators can keep ahead of the demand for space. With PowerShell 2 it is simple to retrieve the information in a single line using the win32_volume WMI class call. Now in this example I am only retrieving four items and rounding the values to two decimal places. There are... read more

How to change several system settings with PowerShell

PowerShell is an awesome addition to Windows and the admins that administer servers.  This post covers a few PowerShell commands to make changes to common settings. Create a drive to HKEY_CLASSES_ROOT & HKEY_CURRENT_USER. By default these two registry geys are not available for mounting and using in PowerShell, but that is an easy fix! if (!(get-psdrive hkcr -ea 0)){New-PSDrive -Name HKCR -PSProvider... read more

How To Start and Stop Services Using PowerShell Remotely

Admit it, you’re an admin that likes to do everything possible from the desk or laptop and if possible from a command line because automation is our friend. With the addition of PowerShell this is getting more of the norm for Windows and starting and stopping services remotely is probably one of the most used. To perform this task we will need to several cmdlets, some get-service stop-service... read more

How To Get Members of a Local Group with PowerShell

Every admin dreads audit and requests for members with privileged access. Some want screen shots, others use scripts and then there are those of us who like to tinker and use PowerShell for Windows. What the result is a script that gets the members of the local Administrators group and export it to a file.   # Get members of local administrator group # getlocaladmins.ps1 $node = hostname # Set the... read more

How to Copy Files between Windows Systems with PowerShell Copy-Item

As a longtime Linux user I have always enjoyed the ease of being able to copy files between systems with scp, ssh and other means. With Windows systems this has been hit or miss in corporate environments with firewalls and block on the un-secure port 445 used by SMB. But with PowerShell there is another way for Windows administrators to enjoy what Linux / Unix admins have enjoyed for years. The copy-item... read more

« Previous Entries Next Entries »

top
Life of a Geek Admin
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.