-
January 5, 2016
Create a PowerShell GUI application to perform remote desktop operation using Microsoft Remote Desktop ActiveX control
In order to get the Remote Desktop Client to function in a .NET project you must obtain the Remote Desktop ActiveX control wrapper (MSTSCLib.dll and AxMSTSCLib.dll). MSTSCLib You may need to unblock the files, since they were downloaded from internet. File –> Right click –> Properties Create PowerShell Winform and add Panel control. Additionally add … Continue reading Create a PowerShell GUI application to perform remote desktop operation using Microsoft Remote Desktop ActiveX control
Get Content -
December 24, 2015
Get Windows Product License Information (including license type and product key) PowerShell/WinForms GUI Tool
Windows License Extractor is a small PowerShell/WinForms GUI tool that will help you to display/export licensing information (including the product key where possible) for your current running operating system, as well as other remote computer systems. This utility can be useful if you lost the product key of your Windows, and you want to reinstall … Continue reading Get Windows Product License Information (including license type and product key) PowerShell/WinForms GUI Tool
Get Content -
December 22, 2015
Windows 10 Store Apps Uninstaller (PowerShell/WinForms)
If you no longer need an app, then you could use Windows 10 Store Apps Uninstaller to remove it and free up space on the drive. Easy way to remove apps via right click -> Uninstall for a single app or in bulk. Lets you remove some of the built-in apps that the Windows … Continue reading Windows 10 Store Apps Uninstaller (PowerShell/WinForms)
Get Content -
May 10, 2015
Get Windows Firewall State on Local or Remote Machine Utilizing Netsh.exe
.SYNOPSIS Displays the Windows Firewall state for Domain, Private, and Public profiles on local or remote computer. .DESCRIPTION Use Get-FirewallState to show current Firewall state that is presented on the Windows Firewall with Advanced Security Properties page, with the tabs for Domain, Private, and Public profiles. .PARAMETER HOSTNAME Specifies the remote or local computer name. When using … Continue reading Get Windows Firewall State on Local or Remote Machine Utilizing Netsh.exe
Get Content -
May 10, 2015
Test-AWSEC2 – Detect if a virtual host is running on Amazon EC2
Amazon EC2 Instances have metadata they can access. They get it by accessing a web server on a link-local address 169.254.169.254. This PowerShell function will attempt to open http connection to the link-local address 169.254.169.254, and if successful will confirm that the host is running on Amazon Elastic Compute Cloud (Amazon EC2). Code:
12345678910111213141516171819#-----------------------------------Detects if a Host is running on AWS EC2---------------------------------------------------------------Function Test-AWSEC2{$error.clear()$request = [System.Net.WebRequest]::Create('http://169.254.169.254/')$request.Timeout = 900try{$response = $request.GetResponse()$response.Close()}catch { $false }if (!$error){$true}} -
January 25, 2015
PowerShell Robocopy GUI Update (PowerCopy 1.0.1)
Few necessary improvements have been made to Robocopy GUI tool. Part of the code was completely rewritten to optimize the Robocopy performance. New functions added to the PowerShell/Robocopy GUI tool: -progress bar -terminate Robocopy process -save preferences The progress bar will indicate how much of the data has been Robocopied. The progress tracking is based … Continue reading PowerShell Robocopy GUI Update (PowerCopy 1.0.1)
Get Content -
January 15, 2015
Get File Shares PowerShell Function
Get-FileShares PowerShell function will enumerate all shares (except administrative, but including those that end in a dollar sign ($) on a remote machine and optionally send the output to a CSV file. The following share properties will be included in the export: ServerName | ShareName | SharePath | Description ServerName ShareName SharePath Description FILESERVER01 \\FILESERVER01\CustomerCare … Continue reading Get File Shares PowerShell Function
Get Content -
January 13, 2015
Outbound Port Scanner
With Outbound Port Scanner you can determine, which outbound ports aren’t blocked by your firewall. This PowerShell tool is extremely helpful when you are behind firewall, and you are running service on a remote machine that you want to connect to it, but you are unable to find out which ports can be accessed and … Continue reading Outbound Port Scanner
Get Content -
December 20, 2014
PowerShell Function: Get Domain/Hostname Geolocation
Get-Geo PowerShell function will resolve the IP address of a domain and return the country name and country code information:
12345PS C:\> Get-Geo yandex.ruDomain Name IP Address Country Name Country Code----------- ---------- ------------ ------------yandex.ru 213.180.204.11 Russian Federation RUSAdd this function to a module or save it as ps1 file and dot source it:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748<#.SYNOPSISGet-Geo - Domain/Hostname Geolocation.DESCRIPTIONResolves the IP address of a domain and returns the country name and country code information..PARAMETER domainSpecifies the domain name (enter the domain name without http:// and www (e.g. power-shell.com)).EXAMPLEGet-Geo -domain microsoft.comGet-Geo microsoft.com.NOTESFile Name: get-geo.ps1Author: Nikolay PetkovBlog: http://77.104.138.174/~powershe/power-shell.comLast Edit: 12/20/2014.LINKhttp://77.104.138.174/~powershe/power-shell.com#>Function Get-Geo {param ([Parameter(Mandatory=$True,HelpMessage='Please enter domain name (e.g. microsoft.com)')][string]$domain)try {$ipadresses = [System.Net.Dns]::GetHostAddresses($domain) |where {$_.AddressFamily -eq "InterNetwork"} `|foreach {$_.IPAddressToString} |Out-String$ip = $ipadresses.Split()[0]} catch {Write-Host "Get-Geo request could not find host $domain. Please check the name and try again." -ForegroundColor Red}$geo = New-WebServiceProxy -uri "http://www.webservicex.net/geoipservice.asmx?WSDL"$results = $geo.GetGeoIP($ip)If ($results.ReturnCodeDetails -eq "Success"){$GeoObject = New-Object PSObjectAdd-Member -inputObject $GeoObject -memberType NoteProperty -name "Domain Name" -value $domainAdd-Member -inputObject $GeoObject -memberType NoteProperty -name "IP Address" -value $results.IPAdd-Member -inputObject $GeoObject -memberType NoteProperty -name "Country" -value $results.CountryNameAdd-Member -inputObject $GeoObject -memberType NoteProperty -name "Country Code" -value $results.CountryCode$GeoObject}else {Write-Host "The $domain GEO location cannot be resolved." -ForegroundColor Red}} #end function Get-Geo -
December 20, 2014
WhoIs PowerShell Function
WhoIs PowerShell function will perform a domain name lookup and return information such as domain availability (creation and expiration date), domain ownership, name servers, etc..
1234567891011121314151617181920212223242526PS C:\> whois power-shell.comConnecting to Web Services URL...OkGathering power-shell.com data...Whois Server Version 2.0Domain names in the .com and .net domains can now be registeredwith many different competing registrars. Go to http://www.internic.netfor detailed information.Domain Name: POWER-SHELL.COMRegistrar: GODADDY.COM, LLCWhois Server: whois.godaddy.comReferral URL: http://registrar.godaddy.comName Server: NS83.SUPERHOSTING.BGName Server: NS84.SUPERHOSTING.BGStatus: clientDeleteProhibitedStatus: clientRenewProhibitedStatus: clientTransferProhibitedStatus: clientUpdateProhibitedUpdated Date: 02-nov-2014Creation Date: 17-oct-2014Expiration Date: 17-oct-2015>>> Last update of whois database: Sat, 20 Dec 2014 17:56:21 GMTAdd this function to a module or save it as ps1 file and dot source it in your profile:
123456789101112131415Function WhoIs {param ([Parameter(Mandatory=$True,HelpMessage='Please enter domain name (e.g. microsoft.com)')][string]$domain)Write-Host "Connecting to Web Services URL..." -ForegroundColor Greentry {If ($whois = New-WebServiceProxy -uri "http://www.webservicex.net/whois.asmx?WSDL") {Write-Host "Ok" -ForegroundColor Green}else {Write-Host "Error" -ForegroundColor Red}Write-Host "Gathering $domain data..." -ForegroundColor Green(($Whois.getwhois(=$domain)).Split("<<<")[0])} catch {Write-Host "Please enter valid domain name (e.g. microsoft.com)." -ForegroundColor Red}} -
December 17, 2014
File Report PowerShell Function
Get-FileReport function creates detailed file report and exports it into CSV format. Description: Use this function to export properties for files of certain type (doc, txt, jpg, etc.), and files older than certain days. The report includes the following file properties: File Name | Full File Path | File Extension | File Size in KB … Continue reading File Report PowerShell Function
Get Content -
November 29, 2014
Custom Logon Screen GUI Tool for Windows 7
Custom Logon Screen GUI tool will help you change the default Windows 7 logon screen background. All you need to do is to select the desired image, and click Change Logon Screen button to apply it. Few things you should be aware of: -Don’t forget to run the tool as administrator. -The selected image file … Continue reading Custom Logon Screen GUI Tool for Windows 7
Get Content -
November 22, 2014
PowerShell-Robocopy GUI Tool
Robocopy GUI tool leverages the command-line utility Robocopy (Robust File Copy - introduced with Windows Server 2003 Resource Kit). Robocopy best features include the option to copy file attributes along with the NTFS permissions, mirror the content of an entire folder hierarchy across local volumes or over a network excluding certain file types, copying files … Continue reading PowerShell-Robocopy GUI Tool Get Content -
November 13, 2014
File Share Quota Manager – Menu Based
File Share Quota Management Tool is a powerful menu based PowerShell script used to remotely control the amount of disk/storage space that a user can utilize on the file server. Quota manager tool will help system administrators to create, modify, enable or disable quotas on remote file servers. The user-friendly navigation through the menus and … Continue reading File Share Quota Manager – Menu Based
Get Content -
November 7, 2014
Create a Link Label using WinForms
The following code is an example how to create a link label using WinForms in PowerShell:
12345678$LinkLabel = New-Object System.Windows.Forms.LinkLabel$LinkLabel.Location = New-Object System.Drawing.Size(20,50)$LinkLabel.Size = New-Object System.Drawing.Size(115,20)$LinkLabel.LinkColor = "#0074A2"$LinkLabel.ActiveLinkColor = "#114C7F"$LinkLabel.Text = "Your Link Text Here"$LinkLabel.add_Click({[system.Diagnostics.Process]::start("http://77.104.138.174/~powershe/power-shell.com")})$Form.Controls.Add($LinkLabel)And here is a demo form showing 3 link labels: Code:
1234567891011121314151617181920212223242526272829303132333435363738#Create Form Object$Form = New-Object System.Windows.Forms.Form$Form.Size = New-Object System.Drawing.Size(400,300)$Form.Text = "Link Label Demo"$Form.StartPosition = "CenterScreen" #loads the window in the center of the screen#Link Label 1$LinkLabel1 = New-Object System.Windows.Forms.LinkLabel$LinkLabel1.Location = New-Object System.Drawing.Size(30,50)$LinkLabel1.Size = New-Object System.Drawing.Size(150,20)$LinkLabel1.LinkColor = "BLUE"$LinkLabel1.ActiveLinkColor = "RED"$LinkLabel1.Text = "Your Link Text Here"$LinkLabel1.add_Click({[system.Diagnostics.Process]::start("http://technet.microsoft.com")})$Form.Controls.Add($LinkLabel1)#Link Label 2$LinkLabel2 = New-Object System.Windows.Forms.LinkLabel$LinkLabel2.Location = New-Object System.Drawing.Size(30,90)$LinkLabel2.Size = New-Object System.Drawing.Size(150,20)$LinkLabel2.LinkColor = "GREEN"$LinkLabel2.ActiveLinkColor = "BLUE"$LinkLabel2.Text = "Your Link Text Here"$LinkLabel2.add_Click({[system.Diagnostics.Process]::start("http://technet.microsoft.com")})$Form.Controls.Add($LinkLabel2)#Link Label 3$LinkLabel3 = New-Object System.Windows.Forms.LinkLabel$LinkLabel3.Location = New-Object System.Drawing.Size(30,130)$LinkLabel3.Size = New-Object System.Drawing.Size(150,20)$LinkLabel3.LinkColor = "RED"$LinkLabel3.ActiveLinkColor = "BLUE"$LinkLabel3.Text = "Your Link Text Here"$LinkLabel3.add_Click({[system.Diagnostics.Process]::start("http://technet.microsoft.com")})$Form.Controls.Add($LinkLabel3)#Show Form$Form.ShowDialog() -
November 4, 2014
PowerShell FSRM Deployment on Windows Server 2012
In order to deploy File Server Resource Manager using PowerShell I'm going to perform the following tasks: 1. Install FSRM role service 2. Create report and templates paths 2. Configure the global FSRM settings 3. Remove built-In file group 4. Create standard file groups 5. Remove built-In file screen templates 6. Create standard file screen … Continue reading PowerShell FSRM Deployment on Windows Server 2012 Get Content
Wonderful Work I Like It….
Windows Firewall Control