diff --git a/count-ad-objects.ps1 b/count-ad-objects.ps1 index e076a7a92c250892be344102b5002a8f346af92e..8057915943febed8cae638d2f1af51a22f01b611 100644 --- a/count-ad-objects.ps1 +++ b/count-ad-objects.ps1 @@ -2,7 +2,8 @@ param( [Parameter(Mandatory=$true)][string]$ComputerName, [switch]$DebugOutput, - [string]$ADModuleSource + [string]$ADModuleSource, + [string]$RootDriveLetter ) function debug($msg) { @@ -40,8 +41,8 @@ $secpass = ConvertTo-SecureString $pass -AsPlainText -Force debug "Creating PSCredential object..." $psCreds = New-Object -typename System.Management.Automation.PSCredential -argumentlist $user, $secpass -# Copy AD module files from wintools to correct locations on X: -$dest = "x:\windows" +# Copy AD module files from wintools to correct locations +$dest = "${RootDriveLetter}:\windows" robocopy /s /r:3 /w:5 $ADModuleSource $dest *.* 2>&1 # Import PowerShell AD module diff --git a/get-lens-info.ps1 b/get-lens-info.ps1 index 2ffc6bb299632d83e78eb4a74de0198ae3d13986..e619ce15a63ffc2e34d9f823d28a54dd4412c907 100644 --- a/get-lens-info.ps1 +++ b/get-lens-info.ps1 @@ -7,10 +7,11 @@ param( # "IP" is safer because it's less likely to return multiple conflicting results [string]$BasedOn="IP", [string]$givenMAC=$false, - [string]$givenIP=$false + [string]$givenIP=$false, + [string]$LogDir ) -$log = "x:\engrit\logs\get-lens-info-script.log" +$log = "$LogDir\get-lens-info-script.log" if($CalledFromTS) { new-item -path $log -itemtype "file" -value "Start of log." }