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 set-UserExtendRightRule{ | |
[cmdletbinding()] | |
param( | |
[parameter(Mandatory=$true)] | |
[string] | |
$userName, | |
[parameter(Mandatory=$true)] | |
[string] | |
$extendedright, |
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
# 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 |
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
#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 |