Skip to content

Instantly share code, notes, and snippets.

View ericjaystevens's full-sized avatar

Eric Stevens ericjaystevens

  • Shelby Township, MI
View GitHub Profile
function set-UserExtendRightRule{
[cmdletbinding()]
param(
[parameter(Mandatory=$true)]
[string]
$userName,
[parameter(Mandatory=$true)]
[string]
$extendedright,
# We cloned our project to C:\sc\PSStackExchange
$ModuleName = 'PSmodName'
$Path = "$env:HOMEPATH\scripts\$($ModuleName)"
$Author = 'EricJayStevens'
$Description = 'PowerShell module to ...'
$version = $PSVersionTable.PSVersion | select -ExpandProperty Major
# Create the module and private function directories
mkdir $Path\$ModuleName
mkdir $Path\$ModuleName\Private
@ericjaystevens
ericjaystevens / getDesktopInfoFromWsus.ps1
Created May 20, 2016 12:53
Get information about all the Windows desktop computers in your environment that are connected to your Windows update server and export it to a csv
#requires PoshWSUS
Import-Module PoshWSUS
$wsusServer = read-host -promt "enter WSUS server name"
Connect-PSWSUSServer $wsusServer -Port 80
$pcs = Get-PSWSUSClient | Where-Object { -not ( $_.osdescription -like "Windows Server*" )}
foreach ($pc in $pcs) {
$pc | Add-Member -notepropertyname department -NotePropertyValue $($pc.requestedTargetGroupNames | select -First 1)
}
$pcs | select fulldomainName,make,model,osdescription,department | Export-Csv computerInventoryInfo.csv