Bart's Weblog

Just a blog…

Archive for the ‘PowerShell’ Category

Quick post: Windows 10 1511 will no longer receive security updates

Posted by bartvdw on 1111/1010/2017

Well that was known well advance, but now it’s really there (10/10/2017): Windows 10 1511 will no longer receive security updates…

MS link: https://support.microsoft.com/en-us/help/4035050/windows-10-version-1511-will-no-longer-receive-security-updates

 

That means, if you haven’t done so yet, it’s advised to check your environment. Normally you already invested time to upgrade these build versions, but I like to double check things now and then.

  1. Your deployment solution (if you haven’t got one… ;-))
  2. Active Directory

 

For the first it’s difficult to collect all possibilities as I mainly work with Symantec Altiris (ITMS), but for AD it’s really straight forward.

 

PowerShell query for all Windows 10 builds before 1607:

Get-ADComputer -Filter {OperatingSystemVersion -like "10.0 (10*"} -Property * | FT Name,OperatingSystem,OperatingSystemVersion -Wrap –Auto

 

Query for all Windows 10 build 1511 specific:

Get-ADComputer -Filter {OperatingSystemVersion -eq "10.0 (10586)"} -Property * | FT Name,OperatingSystem,OperatingSystemVersion -Wrap –Auto

 

Build version translations:

  • 1511 = 10586
  • 1607 = 14393
  • 1703 = 1506

 

References

Inventorying Computers with AD PowerShell – https://blogs.technet.microsoft.com/askds/2010/02/04/inventorying-computers-with-ad-powershell/

 

Advertisements

Posted in Active Directory, PowerShell, Windows 10 | Leave a Comment »

WSUS: Automatically Declining Itanium Updates

Posted by bartvdw on 0606/0505/2013

This is quiet useful, and easier then using the GUI to filter them out…

Automatically Declining Itanium Updates in WSUS
http://gallery.technet.microsoft.com/scriptcenter/Automatically-Declining-a4fec7be

Adapt the code if you don’t want to have an email sent (ex. output to screen or dump in a text file).

Posted in PowerShell, WSUS | 5 Comments »

Citrix: Documenting a Citrix XenApp 6.5 Farm with Microsoft PowerShell

Posted by bartvdw on 0606/0505/2013

Documenting a Citrix XenApp 6.5 Farm with Microsoft PowerShell
http://carlwebster.com/documenting-a-citrix-xenapp-6-5-farm-with-microsoft-powershell/

Posted in Citrix, PowerShell | Leave a Comment »

Citrix: List all installed Hotfixes and Rollup Packs (PowerShell) (XenApp)

Posted by bartvdw on 0606/0505/2013

Citrix XenApp Powershell : List all installed Hotfixes and Rollup Packs
http://www.brichet.be/?p=393

If you for example only wants a list of updates, change the command like follows (example):

$Hotfixes = Get-XAServerHotfix $Server.ServerName | Select HotfixName

If you receive an error regarding “Out-GridView”, remove that line and run the script using “> output.txt” or use another method.

Posted in Citrix, PowerShell | Leave a Comment »

WSUS: PoshPAIG (PowerShell Patch Audit/Installation GUI)

Posted by bartvdw on 0606/0505/2013

PoshPAIG (PowerShell Patch Audit/Installation GUI)
http://poshpaig.codeplex.com

Posted in Microsoft, PowerShell, WSUS | Leave a Comment »

PowerShell: WSUS cleanup script

Posted by bartvdw on 0808/0606/2012

This script allows you to schedule WSUS cleanup on a regular basis.

[reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration") | out-null
$wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer();
$cleanupScope = new-object Microsoft.UpdateServices.Administration.CleanupScope;
$cleanupScope.DeclineSupersededUpdates = $true       
$cleanupScope.DeclineExpiredUpdates         = $true
$cleanupScope.CleanupObsoleteUpdates     = $true
$cleanupScope.CompressUpdates                  = $true
#$cleanupScope.CleanupObsoleteComputers = $true
$cleanupScope.CleanupUnneededContentFiles = $true
$cleanupManager = $wsus.GetCleanupManager();
$cleanupManager.PerformCleanup($cleanupScope);

WSUS Cleanup
http://gallery.technet.microsoft.com/ScriptCenter/fd39c7d4-05bb-4c2d-8a99-f92ca8d08218/

Posted in PowerShell, WSUS | Leave a Comment »

PowerShell: Return wandering VMs to their preferred ESX host

Posted by bartvdw on 0303/0909/2011

For the people that want to place VMs at specific ESX hosts, the scripts in the link below will make your life easy!

Return wandering VMs to their preferred ESX host

Posted in PowerShell, VMware | Leave a Comment »

PowerShell: Outlook unified signature based on Active Directory information

Posted by bartvdw on 0303/0909/2011

I came across this nice PowerShell solution to have unified Outlook signature based on Active Directory information in your company. Check it out!

Outlook signature based on user information from Active Directory

Deploying a Unified Email Signature Template in Outlook

Microsoft TechNet Script Center link: Outlook signature based on user information from Active Directory

Posted in Active Directory, Outlook, PowerShell | Leave a Comment »

PowerShell: Protect all OU’s in Active Directory from accidental deletion

Posted by bartvdw on 1313/0808/2011

1) Check which OUs aren’t protected:
Get-ADOrganizationalUnit -filter * -Properties ProtectedFromAccidentalDeletion | where {$_.ProtectedFromAccidentalDeletion -eq $false} | ft

2) Protect them:
Get-ADOrganizationalUnit -filter * -Properties ProtectedFromAccidentalDeletion | where {$_.ProtectedFromAccidentalDeletion -eq $false} | Set-ADOrganizationalUnit -ProtectedFromAccidentalDeletion $true

3) Then rerun the first command to verify they have been changed.

These commands should run with "Active Directory Module for Windows PowerShell" for AD only or "PowerShell Modules" to load all of them.

AD DS: All OUs in this domain should be protected from accidental deletion
http://technet.microsoft.com/en-us/library/dd723677%28WS.10%29.aspx

Posted in Active Directory, PowerShell | 9 Comments »

PowerShell: How to retrieve disk size & free disk space for a list of computers (input file)

Posted by bartvdw on 1919/0606/2008

Note: works only with V2 which is currently in CTP stage!

The command below will show you a very nice overview of disk size & free space for a list of computers (input file). The great thing about PowerShell, from my point of view, is “piping” commands into 1 big command which eliminates the need to create a script for certain operations. Secondly in V2 (CTP), the “gridview” option is amazing!

Get-WMIObject Win32_LogicalDisk -filter “DriveType=3″ -computer (Get-Content c:\scripts\computers.txt) | Select SystemName,DeviceID,VolumeName,@{Name=”size(GB)”;Expression={“{0:N1}” -f($_.size/1gb)}},@{Name=”freespace(GB)”;Expression={“{0:N1}” -f($_.freespace/1gb)}} | Out-GridView

Posted in PowerShell, Scripting | 39 Comments »