Tag Archives: Powershell

Set processor affinity for scom agent

Problem SCOM agent tasks are consuming 100% processor time causing a slow reaction time on servers. Solution Force SCOM agent processes to run on one CPU-core so other tasks get processor time. To achieve this add a scheduled task running … Continue reading

Posted in Fix IT | Tagged , | Comments Off on Set processor affinity for scom agent

Revoke certificate from Microsoft PKI

This solution is based on powershell module PSPKI . Here is a link to download it : https://www.powershellgallery.com/packages/PSPKI/3.2.7.0 Open Poweshell and run the following commands View Code PS11 2 3 4 5 6 7 8 Import-Module PSPKI $sCAServer = "<FQDN … Continue reading

Posted in Fix IT | Tagged , | Comments Off on Revoke certificate from Microsoft PKI

Kill all but own powershell process

use the following command within powershell to terminate all but your one shell. get-process | where {$_.name -like “powershell” -and $_.ID  -notlike “$pid”} | stop-process

Posted in Information Technology | Tagged | Comments Off on Kill all but own powershell process

Find existing UPN in Forest

A userPrincipalName (UPN) must be unique in a Active Directory Forest. To check for an existing UPN use the following lines. The script expects that all DC’s within the Root Domain are GC enabled . View Code PS11 2 3 … Continue reading

Posted in Information Technology | Tagged , , | Comments Off on Find existing UPN in Forest

Force replication on all domain controller of a domain

The following line searches for all Domain Controllers of a Domain . Then it filters some Computers by IP (10.10.10.*) to eliminate RODCs and finally forces replication on each remaining Domain Controller. View Code PS11 2 $Domain = "Contoso.com" Get-ADDomainController … Continue reading

Posted in Information Technology | Tagged , , | Comments Off on Force replication on all domain controller of a domain

List disk drives into an array

This script ist playing with an “athook” object based on an array having different named properties . $Array = @() Foreach ($vol In GET-WMIOBJECT win32_logicaldisk)  {  $obj = New-Object PSObject  $Value = $vol.DeviceID  $obj | Add-Member -MemberType NoteProperty -Name “Drive” -value $Value … Continue reading

Posted in Information Technology | Tagged | Comments Off on List disk drives into an array

Get Domain from distinguished Name

Get Domain from FQDN: get-domfqdn “CN=Test,OU=Orgunit,DC=contoso,DC=test” will result in contoso.test   function get-domfqdn ($fqdn)  {  $afqdn= $fqdn.split(“,”)  $first = 0  $Dom=””  foreach ($pfqdn in $afqdn)   {   If ($pfqdn.contains(“DC=”) -eq $true)    {    If ($first -eq 1)     {            $Dom = $Dom+”.” … Continue reading

Posted in Information Technology | Tagged , , | Comments Off on Get Domain from distinguished Name