Share Permissions Export

Folder permissions export in Powershell, the export can be opened in Excel and the data can be sorted by column “IsInherited” equal to false.

$OutFile = “C:\temp\permissionsProdDev.csv”
$Header = “Folder Path,IdentityReference,AccessControlType,IsInherited,InheritanceFlags,PropagationFlags”
Del $OutFile
Add-Content -Value $Header -Path $OutFile

$RootPath = “\profile\ProdDev”

$Folders = dir $RootPath -recurse | where {$_.psiscontainer -eq $true}

foreach ($Folder in $Folders){
$ACLs = get-acl $Folder.fullname | ForEach-Object { $_.Access }
Foreach ($ACL in $ACLs){
$OutInfo = $Folder.Fullname + “,” + $ACL.IdentityReference + “,” + $ACL.AccessControlType + “,” + $ACL.IsInherited + “,” + $ACL.InheritanceFlags + “,” + $ACL.PropagationFlags
Add-Content -Value $OutInfo -Path $OutFile
}}

Folder Permissions

Run the below in powershell and change the share name and output file location

 

 

$FolderPath = dir -Directory -Path “\\EETDC01\Shared” -Recurse -Force
$Report = @()
Foreach ($Folder in $FolderPath) {
$Acl = Get-Acl -Path $Folder.FullName
foreach ($Access in $acl.Access)
{
$Properties = [ordered]@{‘FolderName’=$Folder.FullName;’AD
Group or
User’=$Access.IdentityReference;’Permissions’=$Access.FileSystemRights;’Inherited’=$Access.IsInherited}
$Report += New-Object -TypeName PSObject -Property $Properties
}
}
$Report | Export-Csv -path “e:\FolderPermissions.csv”

sophos tamper protection disable

  1. Boot the system into Safe Mode. This means you have to restart your device and as soon as you see the start screen, for example the windows logo, press the key F8.
  2. Click Start > Run and type regedit and then click OK.
  3. Go to the following location in the registry editor: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Sophos MCS Agent and set the REG_DWORD Start to 0x00000004
  4. Go to the following location in the registry editor: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Sophos Endpoint Defense\TamperProtection\Config and set the following REG_DWORD values SAVEnabled and SEDEnabled to 0
  5. Go to the following location in the registry editor: HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Sophos\SAVService\TamperProtection and set the REG_DWORD Enabled to 0
  6. Reboot the system in normal boot.

Enhanced Tamper Protection is now disabled and you should be able to access the system.

Exchange Powershell edit calendar permissions

Add-MailboxFolderPermission -Identity erossbryant@mckenzie-group.com.au:\calendar -User njones@mckenzie-group.com.au -AccessRights Owner

set-MailboxFolderPermission -Identity erossbryant@mckenzie-group.com.au:\calendar -User njones@mckenzie-group.com.au -AccessRights Owner

Get-MailboxFolderPermission -Identity erossbryant@mckenzie-group.com.au:\calendar |fl

login office365 powershell

to set execution
Set-ExecutionPolicy unrestricted

To login
$LiveCred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection
Import-PSSession $Session
Import-module Msonline
Connect-MsolService -Credential $Livecred
to remove an smtp address
Set-Mailbox -identity iwilliams -EmailAddresses @{remove=”iwilliams@scholzgroup.com.au”}