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
# Fix ownership | |
# Is it correct that it changes ownership only for subfolder "service"? | |
# Why "machine" and not "HKEY_LOCAL_MACHINE? | |
.\TakeRegistryOwnership.exe MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\webmanagement\service | |
# Add registry keys | |
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\webmanagement\service /v EncryptionMode /t REG_DWORD /d 0x3 /f | |
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\webmanagement\service /v HttpsPort /t REG_DWORD /d 4443 /f | |
# add corresponding firewall rules |
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
# List all VPN connections | |
Get-VPNConnection | |
# Enable split-tunneling for a specific connection | |
Set-VPNConnection -name "<see list>" -SplitTunneling $true |
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
# Script to inform multiple users via Mail | |
# Two datasources | |
# 1. Old Firewall VPN Config -> Exported as XML | |
# 2. Active Directory Accounts | |
$date = (get-date) | |
# Which file should be send with the mail as an attachment? | |
$attachment = "C:\Users\xyz\Documents\beispiel-anhang.txt" |
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
function Import-Portatour { | |
param ( | |
[parameter(Mandatory=$True,Position=1)] [ValidateScript({ Test-Path -PathType Leaf $_ })] [String] $FilePath, | |
[parameter(Mandatory=$False,Position=2)] [System.URI] $ResultURL | |
) | |
# CONST | |
$CODEPAGE = "iso-8859-1" # alternatives are ASCII, UTF-8 | |
# We have a REST-Endpoint | |
$RESTURL = "https://my.portatour.net/a/api/ImportCustomers/" |
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
#require -version 2.0 | |
# based on source from: http://www.nivot.org/blog/post.aspx?id=1f8255b2-05a7-4947-8dc3-01ce3c478cc2 | |
# does not really work, because the waithandle is not processed correctly | |
# using $wait[$i].WaitOne() in for-loop would work, but is not the right way to process jobs in parallel | |
# create a pool of 10 runspaces | |
$pool = [runspacefactory]::CreateRunspacePool(1,10) | |
$pool.Open() |
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
function Get-XTSSession() { | |
Param ([Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, HelpMessage="UserName?")] | |
$User ) | |
$aco_servers = "C:\Users\adm-ml\Documents\WindowsPowerShell\Modules\PSTerminalServices\aco-terminal-servers.txt" | |
$workingDirectory = (get-location) | |
if ($user.gettype().fullname -eq "System.String") { | |
if ($user -ne $null -and $user.length -gt 0) { | |
$username = $user |
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
// "my:Inhalte" --> Repeating table data | |
public void Projektinformationen_Changed(object sender, XmlEventArgs e) | |
{ | |
//e.Operation property is equal to XmlOperation.Insert or XmlOperation.Delete | |
XPathNavigator nav = MainDataSource.CreateNavigator(); | |
XPathNodeIterator iter = nav.Select("/my:meineFelder/my:Inhalte/my:Position", NamespaceManager); | |
int i = 1; |
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
Sub Pfad_anzeigen() | |
Dim ordner As Outlook.MAPIFolder | |
Dim ordnerPfad As String | |
Set ordner = Application.ActiveExplorer.Selection.Item(1).parent | |
ordnerPfad = ordner.Name | |
Do Until ordner.parent = "Mapi" | |
Set ordner = ordner.parent |
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
function Get-XADUserPasswordExpirationDate() { | |
Param ([Parameter(Mandatory=$false, Position=0, ValueFromPipeline=$true, HelpMessage="Identity of the Account")] | |
[Object] $accountIdentity ) | |
PROCESS { | |
If ($accountIdentity -eq $null) { | |
$computer = Get-WmiObject win32_computerSystem -ComputerName "." | |
$user = $computer.UserName.Split("\") | |
$accountIdentity = $user[$user.length-1] |
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
function XADGroupCopy() { | |
param( | |
[parameter(Mandatory=$true,Position=0,HelpMessage="Von welchem User sollen Berechtigungen kopiert werden?")] | |
[String] | |
$fromUser, | |
[parameter(Mandatory=$true,Position=1,HelpMessage="Welcher User erhaelt die neuen Gruppen?")] | |
[String] | |
$toUser | |
) |
NewerOlder