PowerShell – get windows 10 versions

Below script lists all Windows 10 versions that are installed on computers in Active Directory:

$win10 = get-adcomputer -filter 'OperatingSystem -like "Windows 10*"' -prop *
$win10count = ($win10 | Sort OperatingSystemVersion).count
$subject = "All Win 10 systems $win10count"
$win10_versions = $win10 | Sort OperatingSystemVersion | Select OperatingSystemVersion -unique

$result = @()
foreach ($ver in $win10_versions) {

$version = $ver.OperatingSystemVersion
$count = ($win10 | where OperatingSystemVersion -like $ver.OperatingSystemVersion | select OperatingSystemVersion | measure ).count
$result += New-Object psobject -Property @{
Win10_version = $version
Count = $Count

Send-MailMessage -From email@address.com -To email@address.com -subject $Subject -Body ($result | out-string) -smtpServer MAIL_SERVER -port 25

Example output:

Win10_version Count
------------- -----
10.0 (10240)      1
10.0 (10586)      9
10.0 (14393)     14
10.0 (15063)      4
10.0 (16299)     23
10.0 (17134)     18
10.0 (17763)     21
10.0 (18362)     35
10.0 (18363)    140
10.0 (19041)      1

Windows 10 and problems accessing smb shares

Last night I had to do some testing under Windows 10 and to my surprise I was unable to access smb network share.

I have done some investigation and it would appear that Windows 10 will try to negotiate SMB3_11, which Samba 4.1.1  doesn’t yet support except in the current 4.3 release candidate.

To fix this I disabled SMB 3 and enabled v1:

To disable SMBv2 and SMBv3 on the SMB client, run the following commands:

sc.exe config lanmanworkstation depend= bowser/mrxsmb10/nsi 
sc.exe config mrxsmb20 start= disabled
To enable SMBv1 on the SMB client, run the following commands:
sc.exe config lanmanworkstation depend= bowser/mrxsmb10/mrxsmb20/nsi 
sc.exe config mrxsmb10 start= auto

After restarting Win10 instance I was back in action.
See more here

WINDOWS – How to uninstall built in Win10 apps

A number of the Windows applications (such as Mail, Money, Weather, Xbox) in Windows 10 have no uninstall option however they are still just AppX packages installed on the OS so can be viewed and removed using PowerShell.

Launch an elevated PowerShell session and then run command:

Get-AppxPackage *<part of package name>* | Remove-AppxPackage

To remove. For example to remove the built-in Mail and Calendar applications I use:

Get-AppxPackage *communi* | Remove-AppxPackage

To view all the packages use:

Get-AppxPackage | ft Name, PackageFullName -AutoSize

Some common ones you may wish to uninstall are listed below with the part of package name to use:

Camera – *camera*
Mail and Calendar – *communi*
People – *people*
Money, Sports, News, Travel, Health, Food and Weather – *bing* or to just remove certain ones use *bingsports*, *bingtravel* etc. Use ‘Get-AppxPackage *bing* | ft Name, PackageFullName -AutoSize‘ to view the names
Groove Music and Movies & TV – *zune*
Xbox – *xbox*
Solitare – *solit*
3D Builder – *3d*