Yearly Archives: 2020

Intune Exchange Connector version is not supported

Microsoft have public this article: https://support.microsoft.com/da-dk/help/4464186/microsoft-intune-exchange-connector-version-not-supported, that tell you to just download a new version from Microsoft Intune Admin portal.

But this warning messages could also happen if you allready have a connector installed on another server, even if microsoft says that the new connector will just replace the old one.
So if you get this warning, just after you have downloaded the software, and you have an old connector, delete the old one first.
Remember to check notice of what User Notification and Unmanaged device access where set to before deleting the old one

List all shares folders and thier permissions

<#
            .SYNOPSIS
            This script will list all shares on a computer, and list all the share permissions for each share.

            .DESCRIPTION
            The script will take a list all shares on a local or remote computer.

            .PARAMETER Computer
            Specifies the computer or array of computers to process

            .INPUTS
            Get-SharePermissions accepts pipeline of computer name(s)

            .OUTPUTS
            Produces an array object for each share found.

            .EXAMPLE
            C:\PS> .\Get-SharePermissions # Operates against local computer.

            .EXAMPLE
            C:\PS> 'computerName' | .\Get-SharePermissions

            .EXAMPLE
            C:\PS> Get-Content 'computerlist.txt' | .\Get-SharePermissions | Out-File 'SharePermissions.txt'

            .EXAMPLE
            Get-Help .\Get-SharePermissions -Full
#>

# Written by BigTeddy November 15, 2011
# Last updated 9 September 2012
# Ver. 2.0
# Thanks to Michal Gajda for input with the ACE handling.
[cmdletbinding()]

param([Parameter(ValueFromPipeline=$True,
    ValueFromPipelineByPropertyName=$True)]$Computer = '.')

$shares = gwmi -Class win32_share -ComputerName $computer | select -ExpandProperty Name
foreach ($share in $shares) {
    $acl = $null
    Write-Host $share -ForegroundColor Green
    Write-Host $('-' * $share.Length) -ForegroundColor Green
    $objShareSec = Get-WMIObject -Class Win32_LogicalShareSecuritySetting -Filter "name='$Share'"  -ComputerName $computer
    try {
        $SD = $objShareSec.GetSecurityDescriptor().Descriptor
        foreach($ace in $SD.DACL){
            $UserName = $ace.Trustee.Name
            If ($ace.Trustee.Domain -ne $Null) {$UserName = "$($ace.Trustee.Domain)\$UserName"}
            If ($ace.Trustee.Name -eq $Null) {$UserName = $ace.Trustee.SIDString }
            [Array]$ACL += New-Object Security.AccessControl.FileSystemAccessRule($UserName, $ace.AccessMask, $ace.AceType)
            } #end foreach ACE
        } # end try
    catch
        { Write-Host "Unable to obtain permissions for $share" }
    $ACL
    Write-Host $('=' * 50)
} # end foreach $share

MSSQL SP_WHO2 order by db / databases

Order sp_who2, after database with this commands:

declare @tempTable table (SPID INT,Status VARCHAR(255),
Login VARCHAR(255),HostName VARCHAR(255),
BlkBy VARCHAR(255),DBName VARCHAR(255),
Command VARCHAR(255),CPUTime INT,
DiskIO INT,LastBatch VARCHAR(255),
ProgramName VARCHAR(255),SPID2 INT,
REQUESTID INT);

 INSERT INTO @tempTable
EXEC sp_who2 

select *
from @tempTable order by DBName