search
top
Currently Browsing: Scripting

Creating Folder Shares with PowerShell

Here is a cool little function that you can use to create a share on a system. Save this function in a PowerShell module and load to your toolset.To run this cfunction you must have full administrator privileges, this function also sets the ErrorActionPreference to stop. function New-Share { param($Path, $Name) try { $ErrorActionPreference = ‘Stop’ if ( (Test-Path $Path) -eq $false) { $null =... read more

Adding Additional Fonts to PowerShell and Command Console

Ever wanted to add a different font to PowerShell and command prompt, we’ll here is an easy way to add it with PowerShell. Open a PowerShell with Administrator privileges and execute the following commands. $key = ‘HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont’ Set-ItemProperty -Path $key -Name ‘000’ -Value ‘Courier New’ To select a font,... read more

Converting User Names to SIDs with Powershell

While doing some Active Directory work ran across a need to translate a user name to a SID (security identifier)  to help find traces of it in the registry. Here is an easy way to do this with PowerShell function. function getSID($name, $domain=$env:userdomain) { $objUser = New-Object System.Security.Principal.NTAccount($domain,$name) $strSID =... read more

Extending PowerShell with modules

With Microsoft adding PowerShell to Windows it opened many different possibilities for the scripter’s and IT Administrators managing hundreds and thousands of servers with automation from their desks. One of the problems with running PowerShell from the desk is that you need modules so you can write such great scripts. In this post I will list a few of the great resources to find the modules and in... read more

Perform In-Place file edit with VBScript

Recently had the need to search and replace a configuration file on a system. This was part of an installation of an older program that required a variable to be replace with the computername. Being that the systems were Windows of several different releases (2000, 2003 and 2008) I could not use Powershell to complete the task and went with vbscript as the tool of choice. Here is what the script looks... read more

« Previous Entries Next Entries »

top