This file contains 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
Get-SCVirtualMachine | Foreach-Object { | |
$vm = $_; | |
$dvd = Get-SCVirtualDVDDrive -VM $vm; | |
if ($dvd.Connection -ne 'None' -and $dvd.Connection -ne $null) { | |
Write-Host $vm.Name $vm.VMHost.Name $dvd.Connection $dvd.Iso | |
} | |
} |
This file contains 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
Dism /Online /Get-Packages | |
Dism /Online /Remove-Package /PackageName:Microsoft-Windows-Client-LanguagePack-Package~31bf3856ad364e35~amd64~de-DE~10.0.18362.1198 |
This file contains 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
$dhcpServers = Get-DhcpServerInDC | |
$Credential = Get-Credential | |
$days = Read-Host "Maximum lease duration in days (scopes with longer periods are set to this value)" | |
$timespan = New-TimeSpan -Days $days | |
foreach ($dhcpServer in $dhcpServers) { | |
Write-Host $dhcpServer.DnsName | |
Set-DhcpServerDnsCredential -Credential $Credential -ComputerName $dhcpServer.DnsName | |
Write-Host " DNS Update credentials set" | |
$scopes = Get-DhcpServerv4Scope -ComputerName $dhcpServer.DnsName |
This file contains 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
$bootevents = Get-WinEvent -FilterHashtable @{logname="Microsoft-Windows-Diagnostics-Performance/Operational"; id=100} | |
$bootevent = [xml]$bootevents[0].ToXml() | |
$bootevent.Event.EventData.Data | |
$shutdownevents = Get-WinEvent -FilterHashtable @{logname="Microsoft-Windows-Diagnostics-Performance/Operational"; id=200} | |
$shutdownevent = [xml]$shutdownevents[0].ToXml() | |
$shutdownevent.Event.EventData.Data |
This file contains 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
$mySiteWebapplicationUrl = "https://mysite.normanbauer.com/" | |
#current Url of your mySite website | |
$mySiteOldUrlValue = "http://mysitetest:80/" | |
#former Url where your pictures do not reside any more | |
$mySiteNewUrlValue = "https://mysite.normanbauer.com:443/" | |
#current Url where your images can be found now | |
$mySite = Get-SPSite $mySiteWebapplicationUrl |
This file contains 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
$schemaContext = Get-ADRootDSE | %{$_.schemaNamingContext} | |
Foreach ($dc in ([System.DirectoryServices.ActiveDirectory.DomainController]::findall( | |
(new-object System.DirectoryServices.ActiveDirectory.DirectoryContext("Domain",$env:USERDNSDOMAIN)))) | | |
%{$_.name}) | |
{ | |
$path = ‘LDAP://’ + $dc + ‘/’ + $schemaContext | |
$Object = [adsi]$path | |
$dc + ‘ ‘ + $Object.objectversion | |
} |
This file contains 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
import-module ActiveDirectory | |
function RestoreComputer($computername) | |
{ | |
If ($computername.substring($computername.length – 1, 1) -ne ‘$’) | |
{ | |
$computername += ‘$’ | |
} | |
$existing = Get-ADObject -Filter {sAMAccountName -eq $computername} |
This file contains 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
Set objXmlHttp = CreateObject("Msxml2.ServerXMLHTTP") | |
objXmlHttp.setOption 2, 13056 'http://msdn.microsoft.com/en-us/library/ms763811(v=VS.85).aspx | |
objXmlHttp.open "GET", "https://urlwithcertificateerror", False | |
objXmlHttp.send | |
wscript.echo objXmlHttp.responseText | |
Set objXmlHttp = Nothing |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"> | |
<soap:Body> | |
<FindItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" Traversal="Shallow"> | |
<ItemShape> | |
<t:BaseShape>IdOnly</t:BaseShape> | |
</ItemShape> | |
<ParentFolderIds> | |
<t:DistinguishedFolderId Id="deleteditems"/> | |
</ParentFolderIds> |
This file contains 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
strComputer = "." | |
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2\Security\MicrosoftVolumeEncryption") | |
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_EncryptableVolume",,48) | |
Dim arEncryptionMethod | |
arEncryptionMethod = Array("None", "AES 128 With Diffuser", "AES 256 With Diffuser", "AES 128", "AES 256", "HARDWARE ENCRYPTION", "XTS AES 128", "XTS AES 256") | |
Dim arProtectionStatus | |
arProtectionStatus = Array("Protection Off", "Protection On", "Protection Unknown") |