This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Parameters - Remove /site/site if this is not applicable to you | |
$SiteURL = "https://XXXX.sharepoint.com/site/site" | |
Connect-PnPOnline $SiteURL -Interactive | |
$FolderSiteRelativeURL = "/Shared Documents/subfolder/subfolder" | |
$downloadPath = "C:\temp" | |
Function Get-SPOFolderStats | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get-localadmins{ | |
[cmdletbinding()] | |
Param( | |
[string]$computerName | |
) | |
$group = get-wmiobject win32_group -ComputerName $computerName -Filter "LocalAccount=True AND SID='S-1-5-32-544'" | |
$query = "GroupComponent = `"Win32_Group.Domain='$($group.domain)'`,Name='$($group.name)'`"" | |
$list = Get-WmiObject win32_groupuser -ComputerName $computerName -Filter $query | |
$list | %{$_.PartComponent} | % {$_.substring($_.lastindexof("Domain=") + 7).replace("`",Name=`"","\")} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (test-path HKLM:\Software\Microsoft\Office\14.0\Outlook) {$bitness = (get-itemproperty HKLM:\Software\Microsoft\Office\14.0\Outlook).Bitness} | |
if (test-path HKLM:\Software\Microsoft\Office\15.0\Outlook) {$bitness = (get-itemproperty HKLM:\Software\Microsoft\Office\15.0\Outlook).Bitness} | |
if (test-path HKLM:\Software\Microsoft\Office\16.0\Outlook) {$bitness = (get-itemproperty HKLM:\Software\Microsoft\Office\16.0\Outlook).Bitness} | |
if (test-path HKLM:\SOFTWARE\WOW6432Node\Microsoft\Office\14.0\Outlook) {$bitness = (get-itemproperty HKLM:\SOFTWARE\WOW6432Node\Microsoft\Office\14.0\Outlook).Bitness} | |
if (test-path HKLM:\SOFTWARE\WOW6432Node\Microsoft\Office\15.0\Outlook) {$bitness = (get-itemproperty HKLM:\SOFTWARE\WOW6432Node\Microsoft\Office\15.0\Outlook).Bitness} | |
if (test-path HKLM:\SOFTWARE\WOW6432Node\Microsoft\Office\16.0\Outlook) {$bitness = (get-itemproperty HKLM:\SOFTWARE\WOW6432Node\Microsoft\Office\16.0\Outlook).Bitness} | |
write-host $Bitness |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
New-ItemProperty "HKLM\SOFTWARE\Microsoft\.NETFramework\v4.0.30319" -Name "SystemDefaultTlsVersions" -Value 1 -PropertyType "DWord" | |
New-ItemProperty "HKLM\SOFTWARE\Microsoft\.NETFramework\v4.0.30319" -Name "SystemDefaultTlsVersions" -Value 1 -PropertyType "DWord" | |
New-ItemProperty "HKLM\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319" -Name "SystemDefaultTlsVersions" -Value 1 -PropertyType "DWord" | |
New-ItemProperty "HKLM\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319" -Name "SystemDefaultTlsVersions" -Value 1 -PropertyType "DWord" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$TPMPRESENT = (Get-Tpm).TpmPresent | |
$TPMENABLED = (Get-Tpm).TpmEnabled | |
$TPMREADY = (Get-Tpm).TpmReady | |
$tpmVersion = Get-WmiObject -Class Win32_Tpm -Namespace root\CIMV2\Security\MicrosoftTpm | Select-Object -Property SpecVersion | |
$tpmVersionOut = $tpmVersion.SpecVersion.Split(",")[0] -as [string] | |
Write-Host "TPM Present: ${TPMPRESENT}, TPM Enabled: ${TPMENABLED}, TPM Ready ${TPMREADY}, TPM Version: ${tpmVersionOut}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Files = Get-ChildItem -Path "your\directory\here" -File -Recurse -Name -Force -ErrorAction SilentlyContinue | Measure-Object | Select-Object @{Name='File(s) Count';Expression={$_.count}} | |
$Folders = Get-ChildItem -Path "your\directory\here" -Directory -Recurse -Name -Force -ErrorAction SilentlyContinue | Measure-Object | Select-Object @{Name='Folder Count';Expression={$_.count}} | |
write-host "Files: $Files" | |
write-host "Folders: $Folders" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$members = net localgroup administrators | | |
where {$_ -AND $_ -notmatch "command completed successfully"} | | |
select -skip 4 | |
$members += $(Get-Date -format 'd') | |
write-host $members | |
#Only keep this line if you are using Datto RMM for a UDF. | |
#New-ItemProperty -PropertyType String "HKLM:\SOFTWARE\CentraStage" -Name "Custom5" -Value $members |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Parameters for source and destination for the Image file | |
# Current script is edited to put the same image on LockScreen and Wallpaper | |
$WallpaperURL = "bloburl from azure" # Change to your fitting | |
$LockscreenUrl = "bloburl from azure" # Change to your fitting | |
$ImageDestinationFolder = "c:\temp" # Change to your fitting - this is the folder for the wallpaper image | |
$WallpaperDestinationFile = "$ImageDestinationFolder\wallpaper.png" # Change to your fitting - this is the Wallpaper image | |
$LockScreenDestinationFile = "$ImageDestinationFolder\LockScreen.png" # Change to your fitting - this is the Lockscreen image |
OlderNewer