This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Remove user profiles from local or remote computer | |
.PARAMETER | |
infosrv [[-computers] <string[]>] [[-username] <string>] | |
.DESCRIPTION | |
the script accepts array of computers passed by pipe. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get-uptime{ | |
param( | |
[Parameter(Mandatory=$False,ValueFromPipeline=$True,ValueFromPipelinebyPropertyName=$True)] | |
[string[]]$computername=$env:COMPUTERNAME | |
) | |
$manyObj =@() | |
foreach($computer in $computername){ | |
$itemObj = New-Object System.Object | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$list = @" | |
1 Partridge in a pear tree | |
2 Turtle Doves | |
3 French Hens | |
4 Calling Birds | |
5 Golden Rings | |
6 Geese a laying | |
7 Swans a swimming | |
8 Maids a milking | |
9 Ladies dancing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import-Csv E:\INPUT.csv | Select machinename,@{name="OSVERSION";expression={(GWmi -Class win32_operatingsystem -computername $_.machinename).caption}} | Export-Csv E:\OUTPUT.csv -encoding UTF8 -NoTypeInformation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
invoke-webrequest -uri "http://www.telize.com/geoip" | ConvertFrom-Json | ft -autosize longitude,latitude,continent_code,timezone |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GWmi -Class win32_operatingsystem -computername "onecomputername","twocomputername" | ft -Property PSComputername,ServicePackMajorVersion,Version, @{Label="BIOSSerial"; Expression={$_.serialnumber}} |