How to encrypt and store credentials securely for use with automation scripts. | InterWorks
interworks.com/blog/trhymer/2013/07/08/powershell-how-encrypt-and-store-credentials-securely-use-automation-scripts/
Powershell, ConfigMgr, Windows Client, Windows server…
interworks.com/blog/trhymer/2013/07/08/powershell-how-encrypt-and-store-credentials-securely-use-automation-scripts/
[PowerShell] Automate Deleting Old Local Profiles from usefulscripts Sent from my iPad
[PowerShell] Getting Bitlocker and LAPS summary report with PowerShell from usefulscripts Sent from my iPad
[PowerShell] Testimo – PowerShell module for Active Directory Health Checks from usefulscripts Sent from my iPad
[PowerShell] PowerShell Modules I’ve worked on in 2019 from usefulscripts Sent from my iPad
[PowerShell] Four commands to help you track down insecure LDAP Bindings before March 2020 from usefulscripts Sent from my iPad
[PowerShell] Visually display Active Directory Nested Group Membership using PowerShell from usefulscripts Sent from my iPad
This function compare what the Distribution Point has in WMI againt ContentLib
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
<# .Synopsis Compare WMI with ContentLIB locally on DP .DESCRIPTION .EXAMPLE .EXAMPLE #> Function Check-PackageWMIvsLIB { $WMIPkgList = Get-WmiObject -Namespace Root\SCCMDP -Class SMS_PackagesInContLib | Select -ExpandProperty PackageID | Sort-Object $ContentLib = (Get-ItemProperty HKLM:SOFTWARE\Microsoft\SMS\DP).ContentLibraryPath $PkgLibPath = ($ContentLib) + ‘\PkgLib’ $PkgLibList = (Get-ChildItem $PkgLibPath | Select -ExpandProperty Name | Sort-Object) $PkgLibList = ($PKgLibList | ForEach-Object {$_.replace(‘.INI’,”")}) $PksinWMIButNotContentLib = Compare-Object -ReferenceObject $WMIPkgList -DifferenceObject $PKgLibList -PassThru | Where-Object { $_.SideIndicator -eq "<=" } $PksinContentLibButNotWMI = Compare-Object -ReferenceObject $WMIPkgList -DifferenceObject $PKgLibList -PassThru | Where-Object { $_.SideIndicator -eq "=>" } write-host write-host Write-Host Items in WMI but not the Content Library -ForegroundColor Green Write-Host ======================================== $PksinWMIButNotContentLib Write-Host Items in Content Library but not WMI -ForegroundColor Green Write-Host ==================================== $PksinContentLibButNotWMI } |
If you want to remove WMI entry that not are in lib
1 |
Get-WMIObject -ComputerName "DPNAME" -Namespace "root\sccmdp" -Query ("Select * from SMS_PackagesInContLib where PackageID = 'PACKAGEID'") | Remove-WmiObject |
Of if you want to remove from ContentLIB
1 2 |
##Delete .ini´s in PkgLib not in WMI Remove-Item -Path "$PkgLibPath\PackageID.INI" -Confirm |
To be used at own…
Read more
With this query you get a list of devices and topuser (primary user) on device
1 2 3 4 5 6 7 8 9 10 11 12 |
SELECT SMS_R_User.FullUserName, SMS_R_User.UniqueUserName, SMS_R_System.Name FROM SMS_R_System INNER JOIN SMS_G_System_SYSTEM_CONSOLE_USAGE ON SMS_G_System_SYSTEM_CONSOLE_USAGE.ResourceId = SMS_R_System.ResourceId INNER JOIN SMS_R_User ON SMS_G_System_SYSTEM_CONSOLE_USAGE.TopConsoleUser = SMS_R_User.UniqueUserName |
www.osdsune.com/home/blog/2019/splash-screen-driver-bios-update