Posts

Powershell to search with string in all GPO

Powershell to search with string in all GPO $string = Read-Host -Prompt "What string do you want to search for?" $DomainName = $env:USERDNSDOMAIN write-host "Finding all the GPOs in $DomainName" Import-Module grouppolicy $allGposInDomain = Get-GPO -All -Domain $DomainName Write-Host "Starting search...." foreach ($gpo in $allGposInDomain) {     $report = Get-GPOReport -Guid $gpo.Id -ReportType Xml     if ($report -match $string) {         $Match = write-host "********** Match found in: $($gpo.DisplayName) **********"     }     else {         $Nomatch = Write-Host "No match in: $($gpo.DisplayName)"     } }

Powershell script for all AD user with Lastlogontimestamp

Powershell script for all AD user with Lastlogontimestamp: Get-ADUser -Filter * -Properties name,samaccountname,enabled,emailaddress,DistinguishedName,description,Lastlogontimestamp,lastlogondate,Department,whenCreated,location | Select-object name,samaccountname,enabled,emailaddress,DistinguishedName,description,lastlogondate,Department,whenCreated,location,@{Name="LastLogonTimeStamp"; Expression={[DateTime]::FromFileTime($_.lastLogonTimestamp).ToString('yyyy-MM-dd_hh:mm:ss')}} | Sort-Object -Property Name | Export-Csv FILENAME.csv

POWERSHELL - Scripts to reset the AdmPwdExpirationTime for AD Computers in LAPS

LAPS powershell script to reset the AdmPwdExpirationTime for AD Computers Import-Module ActiveDirectory Import-CSV "C:\Test.csv" | ForEach-Object { $Computer = $_.ComputerName Set-ADComputer -Identity $Computer -Clear ms-Mcs-AdmPwdExpirationTime  } # | Out-File -filepath "C:\output.txt"

Troubleshooting SCEP certificate profile deployment to Android devices in Microsoft Intune

Image
Introduction This guide provides an architectural overview of SCEP certificate profile deployment to Android devices in Microsoft Intune, including how to verify that each step is successful. It also provides troubleshooting suggestions for some of the most common issues that you may encounter during the deployment process. It's assumed that you have configured the NDES server, the Trusted Root profile and SCEP profile. In the example in this guide, the Trusted Root and SCEP profiles are named as follows: Trusted Root Profile: AndroidNorthEndRootCert SCEP profile: AndroidSCEP Overview of SCEP communication flow NDES and SCEP issues are some of the most challenging problems that may be encountered when you use Microsoft Intune. Having a basic understanding of the architecture and the communication flow of the SCEP process helps you identify or narrow the scope of the issue. It's important to understand how to collect logs, ...