Anlage des Repos
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
18.10.2017-19:59:51:
|
||||
18.10.2017-19:59:51: ********************************************************************************
|
||||
18.10.2017-19:59:51: Program Startup: Test-windreamConnectivity on DD-VMX01-RDS01,
|
||||
18.10.2017-19:59:51: from Account DIGITALDATA\KammM.
|
||||
18.10.2017-19:59:51: ********************************************************************************
|
||||
18.10.2017-19:59:51:
|
||||
18.10.2017-19:59:51: --------------------------------------------------------------------------------
|
||||
18.10.2017-19:59:51: Testing for windream availability.
|
||||
18.10.2017-19:59:51: --------------------------------------------------------------------------------
|
||||
18.10.2017-19:59:51:
|
||||
18.10.2017-19:59:51: --------------------------------------------------------------------------------
|
||||
18.10.2017-19:59:51: Availability Test failed!
|
||||
18.10.2017-19:59:51: --------------------------------------------------------------------------------
|
||||
18.10.2017-19:59:51: windream Drive Test (True = Drive available, False = Drive unavailable): True
|
||||
18.10.2017-19:59:51: windream Session Test (True = Session OK, False = Session not OK):
|
||||
18.10.2017-19:59:51:
|
||||
18.10.2017-19:59:51: Trying to fix the Problem. This is Try: 1 out of 5
|
||||
18.10.2017-19:59:51:
|
||||
18.10.2017-19:59:51: --------------------------------------------------------------------------------
|
||||
18.10.2017-19:59:51: Testing for windream availability.
|
||||
18.10.2017-19:59:51: --------------------------------------------------------------------------------
|
||||
18.10.2017-19:59:51:
|
||||
18.10.2017-19:59:51: --------------------------------------------------------------------------------
|
||||
18.10.2017-19:59:51: Availability Test failed!
|
||||
18.10.2017-19:59:51: --------------------------------------------------------------------------------
|
||||
18.10.2017-19:59:51: windream Drive Test (True = Drive available, False = Drive unavailable): True
|
||||
18.10.2017-19:59:51: windream Session Test (True = Session OK, False = Session not OK):
|
||||
18.10.2017-19:59:51:
|
||||
18.10.2017-19:59:51: Trying to fix the Problem. This is Try: 2 out of 5
|
||||
18.10.2017-19:59:51:
|
||||
18.10.2017-19:59:51: --------------------------------------------------------------------------------
|
||||
18.10.2017-19:59:51: Testing for windream availability.
|
||||
18.10.2017-19:59:51: --------------------------------------------------------------------------------
|
||||
18.10.2017-19:59:52:
|
||||
18.10.2017-19:59:52: --------------------------------------------------------------------------------
|
||||
18.10.2017-19:59:52: Availability Test failed!
|
||||
18.10.2017-19:59:52: --------------------------------------------------------------------------------
|
||||
18.10.2017-19:59:52: windream Drive Test (True = Drive available, False = Drive unavailable): True
|
||||
18.10.2017-19:59:52: windream Session Test (True = Session OK, False = Session not OK):
|
||||
18.10.2017-19:59:52:
|
||||
18.10.2017-19:59:52: Trying to fix the Problem. This is Try: 3 out of 5
|
||||
18.10.2017-19:59:52:
|
||||
18.10.2017-19:59:52: --------------------------------------------------------------------------------
|
||||
18.10.2017-19:59:52: Testing for windream availability.
|
||||
18.10.2017-19:59:52: --------------------------------------------------------------------------------
|
||||
18.10.2017-19:59:52:
|
||||
18.10.2017-19:59:52: --------------------------------------------------------------------------------
|
||||
18.10.2017-19:59:52: Availability Test failed!
|
||||
18.10.2017-19:59:52: --------------------------------------------------------------------------------
|
||||
18.10.2017-19:59:52: windream Drive Test (True = Drive available, False = Drive unavailable): True
|
||||
18.10.2017-19:59:52: windream Session Test (True = Session OK, False = Session not OK):
|
||||
18.10.2017-19:59:52:
|
||||
18.10.2017-19:59:52: Trying to fix the Problem. This is Try: 4 out of 5
|
||||
18.10.2017-19:59:52:
|
||||
18.10.2017-19:59:52: --------------------------------------------------------------------------------
|
||||
18.10.2017-19:59:52: Testing for windream availability.
|
||||
18.10.2017-19:59:52: --------------------------------------------------------------------------------
|
||||
18.10.2017-19:59:52:
|
||||
18.10.2017-19:59:52: --------------------------------------------------------------------------------
|
||||
18.10.2017-19:59:52: Availability Test failed!
|
||||
18.10.2017-19:59:52: --------------------------------------------------------------------------------
|
||||
18.10.2017-19:59:52: windream Drive Test (True = Drive available, False = Drive unavailable): True
|
||||
18.10.2017-19:59:52: windream Session Test (True = Session OK, False = Session not OK):
|
||||
18.10.2017-19:59:52:
|
||||
18.10.2017-19:59:52: Trying to fix the Problem. This is Try: 5 out of 5
|
||||
18.10.2017-20:00:17:
|
||||
18.10.2017-20:00:17: --------------------------------------------------------------------------------
|
||||
18.10.2017-20:00:17: Checking for old LogFiles.
|
||||
18.10.2017-20:00:17: --------------------------------------------------------------------------------
|
||||
18.10.2017-20:00:17: Files should be removed which are older than 60 Day(s).
|
||||
18.10.2017-20:00:17: Found no old Files.
|
||||
18.10.2017-20:00:17:
|
||||
18.10.2017-20:00:17: ********************************************************************************
|
||||
18.10.2017-20:00:17: Program Completed: Test-windreamConnectivity on DD-VMX01-RDS01,
|
||||
18.10.2017-20:00:17: from Account DIGITALDATA\KammM.
|
||||
18.10.2017-20:00:17: ********************************************************************************
|
||||
@@ -0,0 +1,880 @@
|
||||
#PowerShell 3.0 Script
|
||||
#This Script will check the windream Connectivity, and restart Client Components if necessary.
|
||||
#Please use the "_Settings.ini"-File for configurations.
|
||||
|
||||
#Digital Data
|
||||
#Ludwig-Rinn-Strasse 16
|
||||
#35452 Heuchelheim
|
||||
#Tel.: 0641 / 202360
|
||||
#E-Mail: info@didalog.de
|
||||
|
||||
#Version Number: 1.0.0.0
|
||||
#Version Date: 21.11.2016
|
||||
|
||||
#Requires –Version 3.0
|
||||
|
||||
#-----------------------------------------------------------------------------------------------------#
|
||||
######################################## check for arguments ##########################################
|
||||
#-----------------------------------------------------------------------------------------------------#
|
||||
|
||||
#By calling this Script with Parameter "-argOperationMode interactive",
|
||||
#you will get MessageBox Notifications for successfull or unsuccessfull Operations.
|
||||
Param (
|
||||
|
||||
[Parameter(Mandatory=$False)]
|
||||
[ValidateSet("interactive", "background")]
|
||||
[String]$argOperationMode
|
||||
|
||||
) #end Param
|
||||
|
||||
#-----------------------------------------------------------------------------------------------------#
|
||||
###################################### add additional assemblys #######################################
|
||||
#-----------------------------------------------------------------------------------------------------#
|
||||
|
||||
Add-Type -AssemblyName System.Windows.Forms -ErrorAction Stop
|
||||
Add-Type -AssemblyName PresentationCore -ErrorAction Stop
|
||||
Add-Type -AssemblyName PresentationFramework -ErrorAction Stop
|
||||
|
||||
#-----------------------------------------------------------------------------------------------------#
|
||||
############################################ set variables ############################################
|
||||
#-----------------------------------------------------------------------------------------------------#
|
||||
|
||||
Set-Variable -Name ScriptName -Value (($MyInvocation.MyCommand.Name) -split "\.")[0].ToString() -Scope Global
|
||||
Set-Variable -Name ScriptPath -Value (Split-Path ($MyInvocation.MyCommand.Path)) -Scope Global
|
||||
Set-Variable -Name ConfigFile -Value (Get-ChildItem -Path "$ScriptPath" -Recurse -Filter "$ScriptName`_Settings.ini" -File -Force).FullName -Scope Global
|
||||
Set-Variable -Name ConfigValues -Value $NULL -Scope Global
|
||||
Set-Variable -Name Timestamp1 -Value $(Get-Date -Format 'ddMMyyyy') -Scope Global
|
||||
Set-Variable -Name Timestamp2 -Value $(Get-Date -Format 'ddMMyyyy_HHmmss') -Scope Global
|
||||
Set-Variable -Name Timestamp3 -Value $(Get-Date -Format 'ddMMyyyy_HHmmssffff') -Scope Global
|
||||
Set-Variable -Name Timestamp4 -Value $(Get-Date -Format 'yyyyMMdd HH:mm:ss.fff') -Scope Global
|
||||
Set-Variable -Name Counter1 -Value 0 -Scope Global
|
||||
Set-Variable -Name LogFile -Value "$ScriptName`_$Timestamp2.log" -Scope Global
|
||||
Set-Variable -Name LogFileKeepTime -Value 60 -Scope Global
|
||||
Set-Variable -Name LogLine -Value $NULL -Scope Global
|
||||
Set-Variable -Name LogPath -Value $NULL -Scope Global
|
||||
Set-Variable -Name LogPaths -Value $NULL -Scope Global
|
||||
Set-Variable -Name ModuleOverrideSourcePath -Value $NULL -Scope Global
|
||||
Set-Variable -Name ModuleDefaultSourcePath -Value $NULL -Scope Global
|
||||
Set-Variable -Name ModuleHKLMRegistryPath -Value "HKLM:\SOFTWARE\Digital Data\Modules" -Scope Global
|
||||
Set-Variable -Name ModuleHKCURegistryPath -Value "HKCU:\SOFTWARE\Digital Data\Modules" -Scope Global
|
||||
|
||||
Set-Variable -Name windreamPathTest -Value $NULL -Scope Global
|
||||
Set-Variable -Name windreamSession -Value $NULL -Scope Global
|
||||
Set-Variable -Name windreamClientRestart -Value $NULL -Scope Global
|
||||
Set-Variable -Name windreamRestartTrys -Value 5 -Scope Global
|
||||
Set-Variable -Name WMEntityDocumentAndMap -Value 0 -Scope Global
|
||||
Set-Variable -Name WMEntityDocument -Value 1 -Scope Global
|
||||
Set-Variable -Name WMEntityFolder -Value 2 -Scope Global
|
||||
|
||||
#-----------------------------------------------------------------------------------------------------#
|
||||
############################################ set functions ############################################
|
||||
#-----------------------------------------------------------------------------------------------------#
|
||||
|
||||
Function Load-PowerShellModule {
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Function will load external - additional - PowerShell Modules into current PSSession.
|
||||
|
||||
.DESCRIPTION
|
||||
By working with Modules, this Function is necessary to load external Modul Functions into the current PowerShell Session.
|
||||
In a productive Enviroment it is recommanded to let this Function set the Registry Key in HKLM for the ModuleSourcePath.
|
||||
In develepment and Test Enviroment it is possible, to work with distributed Folders with different Modules. Therefor the Parameter
|
||||
"ModuleOverrideSourcePath" and the preset Variable "ModuleDefaultSourcePath" are made for.
|
||||
After a successful Import of a Module, Function will Return $True, otherwise a $False.
|
||||
|
||||
.REQUIREMENT General
|
||||
PowerShell V3
|
||||
|
||||
.REQUIREMENT Assembly
|
||||
System.Windows.Forms, PresentationCore, PresentationFramework
|
||||
|
||||
.REQUIREMENT Variables
|
||||
ModuleOverrideSourcePath, ModuleName, Path, Paths, PathTest, FileTest, Result
|
||||
|
||||
.REQUIREMENT Variables preSet
|
||||
ScriptName, ScriptPath, ModuleDefaultSourcePath, Counter
|
||||
|
||||
.REQUIREMENT Functions
|
||||
<NONE>
|
||||
|
||||
.VERSION
|
||||
1.0.0.0 / 11.09.2016
|
||||
|
||||
.PARAMETER ModuleName
|
||||
Give the Module Name, you want to load into the current PSSession (without File-Extension).
|
||||
|
||||
.PARAMETER ModuleOverrideSourcePath
|
||||
Optional Parameter. By giving the ModuleOverrideSourcePath, Function will not check other Paths for the Function you want to load.
|
||||
|
||||
.PARAMETER ModuleFileExtension
|
||||
Optional Parameter. Give the Module File-Extension (regular: "psm1") without a dot ("."), this is just for the checking routine, not the Import itself.')]
|
||||
|
||||
.PARAMETER Force
|
||||
Optional Parameter. By using the Force Parameter, Module will be unload and reload.
|
||||
|
||||
.EXAMPLE
|
||||
Load-PowerShellModule -ModuleName Write-LogFile -ModuleFileExtension psm1
|
||||
|
||||
.EXAMPLE
|
||||
Load-PowerShellModule -ModuleName Write-LogFile -Force
|
||||
|
||||
.EXAMPLE
|
||||
Load-PowerShellModule -ModuleName Write-LogFile -ModuleFileExtension psm1 -ModuleOverrideSourcePath D:\ScriptFiles\Modules
|
||||
#>
|
||||
|
||||
[cmdletbinding()]
|
||||
|
||||
Param (
|
||||
|
||||
[Parameter(Position=0,Mandatory=$True,ValueFromPipeline=$True,HelpMessage='Give the ModuleName, you want to load into the current PSSession (without File-Extension)')]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[String]$ModuleName,
|
||||
|
||||
[Parameter(mandatory=$False,HelpMessage='Optional Parameter. By giving the ModuleOverrideSourcePath, Function will not check other Paths for the Function you want to load.')]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[String]$ModuleOverrideSourcePath,
|
||||
|
||||
[Parameter(mandatory=$False,HelpMessage='Optional Parameter. Give the Module File-Extension (regular: "psm1") without a dot ("."), this is just for the checking routine, not the Import itself.')]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[String]$ModuleFileExtension = "psm1",
|
||||
|
||||
[Parameter(mandatory=$False,HelpMessage='Optional Parameter. By using the Force Parameter, Module will be unload and reload.')]
|
||||
[Switch]$Force
|
||||
|
||||
) #end param
|
||||
|
||||
|
||||
Process {
|
||||
|
||||
#Clear Error Variable
|
||||
$error.clear()
|
||||
|
||||
#If FileExtension was given, remove it! Because otherwise "Import-Module" Function will have trouble importing.
|
||||
$ModuleName = $ModuleName.Replace(".$ModuleFileExtension","")
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: You want to load Module $ModuleName"
|
||||
|
||||
#Try this if $ModuleOverrideSourcePath was given by calling the function
|
||||
IF ((([String]::IsNullOrWhiteSpace($ModuleOverrideSourcePath)) -ne $true) -and (([String]::IsNullOrEmpty($ModuleOverrideSourcePath)) -ne $true)) {
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Function has been called with 'ModuleOverrideSourcePath' Parameter input!"
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Testing for existence: $ModuleOverrideSourcePath\$ModuleName.$ModuleFileExtension"
|
||||
$PathTest = Test-Path -Path "$ModuleOverrideSourcePath\$ModuleName.$ModuleFileExtension" -PathType Leaf
|
||||
|
||||
IF ($PathTest -eq $true) {
|
||||
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: $ModuleOverrideSourcePath and ModuleName seems to exist."
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Trying to import Module: $ModuleName.$ModuleFileExtension"
|
||||
|
||||
Try {
|
||||
|
||||
$Result = Import-Module $ModuleOverrideSourcePath\$ModuleName -Verbose -DisableNameChecking -Scope Global -Force:$Force -PassThru -ErrorVariable Error -ErrorAction SilentlyContinue
|
||||
|
||||
IF ("$Result" -eq "$ModuleName") {
|
||||
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Successfully loaded Module: $ModuleName.$ModuleFileExtension"
|
||||
Return $True
|
||||
|
||||
} #end if
|
||||
|
||||
ELSE {
|
||||
|
||||
Write-Error "DEBUG Info - Load-PowerShellModule: Unsuccessfully loaded Module: $ModuleName.$ModuleFileExtension"
|
||||
Return $False
|
||||
|
||||
} #end else
|
||||
|
||||
} #end try
|
||||
|
||||
Catch {
|
||||
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Error while importing the Module:"
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: $ModuleName"
|
||||
Write-Host $Error
|
||||
Return $False
|
||||
|
||||
} #end catch
|
||||
|
||||
} #end if
|
||||
|
||||
ELSE {
|
||||
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: ModuleOverrideSourcePath and/or ModuleName seems not to exist."
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Cannot load Module, please check your input!"
|
||||
Return $False
|
||||
|
||||
} #end else
|
||||
|
||||
} #end if
|
||||
|
||||
#If $ModuleOverrideSourcePath was not given, try to find a matching folder
|
||||
ELSE {
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Function has been called without 'ModuleOverrideSourcePath' Parameter input!"
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Trying to find Module Files on some Places of this Computer."
|
||||
|
||||
#Set dynamic Array for locations Modul Path could be, even for some testing.
|
||||
#The first value of the array is just a dummy and will never be used -but keep it for the array value starting with 0!
|
||||
[System.Collections.ArrayList]$Paths = @()
|
||||
Write-Host ""
|
||||
$Paths.Add("$env:systemroot\") | Out-Null
|
||||
|
||||
IF (([String]::IsNullOrEmpty($ModuleDefaultSourcePath)) -or ([String]::IsNullOrWhiteSpace($ModuleDefaultSourcePath))) {
|
||||
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: ModuleDefaultSourcePath was not set! That could be a normal behavior in productive enviroment!"
|
||||
|
||||
} #end if
|
||||
|
||||
ELSE {
|
||||
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Possible Path (1): $ModuleDefaultSourcePath" -ErrorAction SilentlyContinue
|
||||
$Paths.Add("$ModuleDefaultSourcePath") | Out-Null
|
||||
|
||||
} #end else
|
||||
|
||||
IF ([String]::IsNullOrEmpty($ScriptPath) -or ([String]::IsNullOrWhiteSpace($ScriptPath))) {
|
||||
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: ScriptPath is invalid! That is terrifying! How could that be???"
|
||||
|
||||
} #end if
|
||||
|
||||
ELSE {
|
||||
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Possible Path (2): $ScriptPath" -ErrorAction SilentlyContinue
|
||||
$Paths.Add("$ScriptPath") | Out-Null
|
||||
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Possible Path (3): $($ScriptPath+"\Module")" -ErrorAction SilentlyContinue
|
||||
$Paths.Add("$($ScriptPath+"\Module")") | Out-Null
|
||||
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Possible Path (4): $($ScriptPath+"\Modules")" -ErrorAction SilentlyContinue
|
||||
$Paths.Add("$($ScriptPath+"\Modules")") | Out-Null
|
||||
|
||||
} #end else
|
||||
|
||||
IF (([String]::IsNullOrEmpty((Get-Item $ScriptPath).Parent.FullName)) -or ([String]::IsNullOrWhiteSpace((Get-Item $ScriptPath).Parent.FullName))) {
|
||||
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: ScriptPath has no Parent Folders!"
|
||||
|
||||
} #end if
|
||||
|
||||
ELSE {
|
||||
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Possible Path (5): $((Get-Item $ScriptPath).Parent.FullName)" -ErrorAction SilentlyContinue
|
||||
$Paths.Add("$((Get-Item $ScriptPath).Parent.FullName)") | Out-Null
|
||||
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Possible Path (6): $(((Get-Item $ScriptPath).Parent.FullName)+"\Module")" -ErrorAction SilentlyContinue
|
||||
$Paths.Add("$(((Get-Item $ScriptPath).Parent.FullName)+"\Module")") | Out-Null
|
||||
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Possible Path (7): $(((Get-Item $ScriptPath).Parent.FullName)+"\Modules")" -ErrorAction SilentlyContinue
|
||||
$Paths.Add("$(((Get-Item $ScriptPath).Parent.FullName)+"\Modules")") | Out-Null
|
||||
|
||||
} #end else
|
||||
|
||||
IF (([String]::IsNullOrEmpty($((Get-ItemProperty -Path "$ModuleHKLMRegistryPath" -Name ModuleSourcePath -ErrorAction SilentlyContinue).ModuleSourcePath))) -or ([String]::IsNullOrWhiteSpace($((Get-ItemProperty -Path "$ModuleHKLMRegistryPath" -Name ModuleSourcePath -ErrorAction SilentlyContinue).ModuleSourcePath)))) {
|
||||
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: ModuleSourcePath was not set to Windows Registry (HKLM)!"
|
||||
|
||||
} #end if
|
||||
|
||||
ELSE {
|
||||
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Possible Path (8): $((Get-ItemProperty -Path "$ModuleHKLMRegistryPath" -Name ModuleSourcePath -ErrorAction SilentlyContinue).ModuleSourcePath)" -ErrorAction SilentlyContinue
|
||||
$Paths.Add("$((Get-ItemProperty -Path "$ModuleHKLMRegistryPath" -Name ModuleSourcePath -ErrorAction SilentlyContinue).ModuleSourcePath)") | Out-Null
|
||||
|
||||
} #end else
|
||||
|
||||
IF (([String]::IsNullOrEmpty($((Get-ItemProperty -Path "$ModuleHKCURegistryPath" -Name ModuleSourcePath -ErrorAction SilentlyContinue).ModuleSourcePath))) -or ([String]::IsNullOrWhiteSpace($((Get-ItemProperty -Path "$ModuleHKCURegistryPath" -Name ModuleSourcePath -ErrorAction SilentlyContinue).ModuleSourcePath)))) {
|
||||
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: ModuleSourcePath was not set to Windows Registry (HKCU)!"
|
||||
|
||||
} #end if
|
||||
|
||||
ELSE {
|
||||
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Possible Path (8): $((Get-ItemProperty -Path "$ModuleHKCURegistryPath" -Name ModuleSourcePath -ErrorAction SilentlyContinue).ModuleSourcePath)" -ErrorAction SilentlyContinue
|
||||
$Paths.Add("$((Get-ItemProperty -Path "$ModuleHKCURegistryPath" -Name ModuleSourcePath -ErrorAction SilentlyContinue).ModuleSourcePath)") | Out-Null
|
||||
|
||||
} #end else
|
||||
|
||||
[Int]$Counter = 0
|
||||
[String]$ModuleSourcePath = $Null
|
||||
|
||||
#Loop for multiple Pathtests - for each Path, where psm1 files could be
|
||||
DO {
|
||||
|
||||
$Counter++
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Testing mutiple Paths ( $Counter of"($($Paths.Count)-1)") for existence, now testing:"
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: $($Paths[$Counter])"
|
||||
|
||||
IF ($($Paths[$Counter]) -gt $Null) {
|
||||
|
||||
$PathTest = Test-Path $($Paths[$Counter]) -ErrorAction SilentlyContinue
|
||||
|
||||
IF ($PathTest -eq $true) {
|
||||
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Yes, Path seems to exist."
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Lets check, if there are any Module Files, in it."
|
||||
|
||||
$FileTest = Get-ChildItem -Path $($Paths[$Counter]) -Filter *.$ModuleFileExtension
|
||||
|
||||
IF ($($FileTest.count) -gt 0) {
|
||||
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Found $($FileTest.count) psm1 Module Files in Path!"
|
||||
Set-Variable -Name ModuleSourcePath -Value $($Paths[$Counter]) -Scope local
|
||||
|
||||
} #end if
|
||||
|
||||
ELSE {
|
||||
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Found no $ModuleFileExtension Module Files in Path!"
|
||||
|
||||
} #end else
|
||||
|
||||
} #end if
|
||||
|
||||
ELSE {
|
||||
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: No, Path seems not to exist."
|
||||
|
||||
} #end else
|
||||
|
||||
} #end if
|
||||
|
||||
ELSE {
|
||||
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Path seems to be invalid!"
|
||||
|
||||
} #end else
|
||||
|
||||
} #end do
|
||||
|
||||
UNTIL ($Counter -ge ($($Paths.Count)-1) -or ($ModuleSourcePath -eq $($Paths[$Counter])))
|
||||
|
||||
IF ($ModuleSourcePath -eq $($Paths[$Counter])) {
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Trying to import Module: $ModuleName.$ModuleFileExtension"
|
||||
|
||||
Try {
|
||||
|
||||
$Result = Import-Module $ModuleSourcePath\$ModuleName -Verbose -DisableNameChecking -Scope Global -Force:$Force -PassThru -ErrorVariable Error -ErrorAction SilentlyContinue
|
||||
|
||||
IF ("$Result" -eq "$ModuleName") {
|
||||
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Successfully loaded Module: $ModuleName.$ModuleFileExtension"
|
||||
Return $true
|
||||
|
||||
} #end if
|
||||
|
||||
ELSE {
|
||||
|
||||
Write-Error "DEBUG Info - Load-PowerShellModule: Unsuccessfully loaded Module: $ModuleName.$ModuleFileExtension"
|
||||
Return $False
|
||||
|
||||
} #end else
|
||||
|
||||
} #end try
|
||||
|
||||
Catch {
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Loading Module: $ModuleName went wrong."
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Exiting Script, because of this error!"
|
||||
Write-Host $Error
|
||||
Return $False
|
||||
exit
|
||||
|
||||
} #end catch
|
||||
|
||||
} #end if
|
||||
|
||||
ELSE {
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Cant locate Module Files automaticlly!"
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Please select Folder in Dialog."
|
||||
|
||||
#Prepare Folder Browser Dialog, to choose the Directory with the .psm1 Files.
|
||||
$FolderBrowserDialog = New-Object System.Windows.Forms.FolderBrowserDialog
|
||||
$FolderBrowserDialog.Rootfolder = "Desktop"
|
||||
$FolderBrowserDialog.Description = "Please, choose the Folder, where the Module ""$ModuleName.$ModuleFileExtension"" is stored."
|
||||
$FolderBrowserDialog.SelectedPath = "$ScriptPath"
|
||||
$FolderBrowserDialog.ShowNewFolderButton = $true
|
||||
|
||||
DO {
|
||||
|
||||
#Now show the Folder Browser, if neccessary in a loop
|
||||
$FolderBrowserDialogShow = $FolderBrowserDialog.ShowDialog()
|
||||
|
||||
#By pressing the OK Button..
|
||||
If ($FolderBrowserDialogShow -eq "OK") {
|
||||
|
||||
#Save selected folder path in the variable
|
||||
$ModuleSourcePath = ($FolderBrowserDialog.SelectedPath)
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: You choose: $ModuleSourcePath"
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: ...testing, if Module ""$ModuleName.$ModuleFileExtension"" can be found there."
|
||||
|
||||
$PathTest = (Test-Path $ModuleSourcePath\$ModuleName.$ModuleFileExtension)
|
||||
|
||||
IF ($PathTest -eq $True) {
|
||||
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Module seems to exist, in the selected Folder."
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Now trying to load Module: $ModuleName.$ModuleFileExtension"
|
||||
|
||||
Try {
|
||||
|
||||
$Result = Import-Module $ModuleSourcePath\$ModuleName -Verbose -DisableNameChecking -Scope Global -Force:$Force -PassThru -ErrorVariable Error -ErrorAction SilentlyContinue
|
||||
|
||||
IF ("$Result" -eq "$ModuleName") {
|
||||
|
||||
$MessageBoxBody = "Module: $ModuleName.$ModuleFileExtension - successsfully loaded into current PSSession!"
|
||||
$MessageBoxTitle = "ScriptName: $ScriptName - Module/Section: Load-PowerShellModule"
|
||||
$MessageBoxButtonType = "OK"
|
||||
$MessageBoxIcon = "Information"
|
||||
$MessageBox = [Windows.Forms.MessageBox]::Show($MessageBoxBody,$MessageBoxTitle,$MessageBoxButtonType,$MessageBoxIcon) | Out-Null
|
||||
|
||||
} #end if
|
||||
|
||||
ELSE {
|
||||
|
||||
$MessageBoxBody = "Module: $ModuleName.$ModuleFileExtension - cannot load into current PSSession!"
|
||||
$MessageBoxTitle = "ScriptName: $ScriptName - Module/Section: Load-PowerShellModule"
|
||||
$MessageBoxButtonType = "OK"
|
||||
$MessageBoxIcon = "Warning"
|
||||
$MessageBox = [Windows.Forms.MessageBox]::Show($MessageBoxBody,$MessageBoxTitle,$MessageBoxButtonType,$MessageBoxIcon) | Out-Null
|
||||
|
||||
} #end else
|
||||
|
||||
} #end try
|
||||
|
||||
Catch {
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Loading Module: $ModuleName.$ModuleFileExtension went wrong."
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Exiting Script, because of this error!"
|
||||
Write-Host $Error
|
||||
exit
|
||||
|
||||
} #end catch
|
||||
|
||||
} #end if
|
||||
|
||||
ELSE {
|
||||
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Module seems not to exist, in the selected Folder."
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Please, select another one! ...this Time the right!"
|
||||
|
||||
$MessageBoxBody = "Module seems not to exist, in the selected Folder! Please, select another one!"
|
||||
$MessageBoxTitle = "ScriptName: $ScriptName - Module/Section: Load-PowerShellModule"
|
||||
$MessageBoxButtonType = "OK"
|
||||
$MessageBoxIcon = "Warning"
|
||||
$MessageBox = [Windows.Forms.MessageBox]::Show($MessageBoxBody,$MessageBoxTitle,$MessageBoxButtonType,$MessageBoxIcon) | Out-Null
|
||||
|
||||
} #end else
|
||||
|
||||
} #end if
|
||||
|
||||
#If you didnt pressed the OK Button..
|
||||
Else {
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Operation cancelled by user."
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Exiting Script, because of this!"
|
||||
exit
|
||||
|
||||
} #end else
|
||||
|
||||
} #end do
|
||||
|
||||
#Variable "$?" is $true when last operation was ok
|
||||
UNTIL ((($PathTest -eq $True) -and ($? -eq $true)) -or ($FolderBrowserDialogShow -eq "Cancel"))
|
||||
|
||||
IF ($ModuleSourcePath -gt $Null) {
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Should ModuleSourcePath written to Windows Registry?"
|
||||
|
||||
$MessageBoxBody = "Would you like to save the ModulePath to the Windows Registry?"
|
||||
$MessageBoxTitle = "ScriptName: $ScriptName - Module/Section: Load-PowerShellModule"
|
||||
$MessageBoxButtonType = "YesNo"
|
||||
$MessageBoxIcon = "Question"
|
||||
$MessageBox = [Windows.Forms.MessageBox]::Show($MessageBoxBody,$MessageBoxTitle,$MessageBoxButtonType,$MessageBoxIcon)
|
||||
|
||||
IF ($MessageBox -eq 'Yes') {
|
||||
|
||||
$PathTest = (Test-Path -Path "$ModuleHKLMRegistryPath")
|
||||
$MessageBox = $NULL
|
||||
|
||||
IF ($PathTest -eq $False) {
|
||||
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Registry Key seems not to exist."
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Trying to write ModuleSourcepath to HKLM."
|
||||
|
||||
Try {
|
||||
|
||||
New-Item -Path "$ModuleHKLMRegistryPath" -Force -ErrorVariable Error -ErrorAction Stop | Out-Null
|
||||
New-ItemProperty -Path "$ModuleHKLMRegistryPath" -Name ModuleSourcePath -Value $ModuleSourcePath -ErrorVariable Error -ErrorAction Stop | Out-Null
|
||||
$env:PSModulePath = $env:PSModulePath + ";" + "$ModuleSourcePath"
|
||||
|
||||
} #end try
|
||||
|
||||
Catch {
|
||||
|
||||
Write-Host $Error
|
||||
$MessageBoxBody = "Could not save ModuleSourcePath to Windows Registry! Check your access rights! To bypass this issue you can write the ModuleSourcePath to User Registry (HKCU). Would you?"
|
||||
$MessageBoxTitle = "ScriptName: $ScriptName - Module/Section: Load-PowerShellModule"
|
||||
$MessageBoxButtonType = "YesNo"
|
||||
$MessageBoxIcon = "Question"
|
||||
$MessageBox = [Windows.Forms.MessageBox]::Show($MessageBoxBody,$MessageBoxTitle,$MessageBoxButtonType,$MessageBoxIcon)
|
||||
|
||||
} #end catch
|
||||
|
||||
} #end if
|
||||
|
||||
ELSEIF ($PathTest -eq $True) {
|
||||
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Registry Key seems to exist."
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Trying to write ModuleSourcepath to HKLM."
|
||||
|
||||
Try {
|
||||
|
||||
Set-ItemProperty -Path "$ModuleHKLMRegistryPath" -Name ModuleSourcePath -Value $ModuleSourcePath -ErrorVariable Error -ErrorAction Stop | Out-Null
|
||||
|
||||
} #end try
|
||||
|
||||
Catch {
|
||||
|
||||
Write-Host $Error
|
||||
$MessageBoxBody = "Could not save ModuleSourcePath to Windows Registry! Check your access rights! To Bypass Error: Write ModuleSource Path to User Registry (HKCU)?"
|
||||
$MessageBoxTitle = "ScriptName: $ScriptName - Module/Section: Load-PowerShellModule"
|
||||
$MessageBoxButtonType = "YesNo"
|
||||
$MessageBoxIcon = "Question"
|
||||
$MessageBox = [Windows.Forms.MessageBox]::Show($MessageBoxBody,$MessageBoxTitle,$MessageBoxButtonType,$MessageBoxIcon)
|
||||
|
||||
} #end catch
|
||||
|
||||
} #end elseif
|
||||
|
||||
ELSE {
|
||||
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Something went wrong, by getting the ModuleSourcePath!"
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Exiting Script, because of this!"
|
||||
exit
|
||||
|
||||
} #end else
|
||||
|
||||
#Block for trying to write the ModuleSourcePath to the User Registry, if System Registry failed.
|
||||
IF ($MessageBox -eq 'Yes') {
|
||||
|
||||
$PathTest = (Test-Path -Path "$ModuleHKCURegistryPath")
|
||||
$MessageBox = $NULL
|
||||
|
||||
IF ($PathTest -eq $False) {
|
||||
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Registry Key seems not to exist."
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Trying to write ModuleSourcepath to HKCU."
|
||||
|
||||
Try {
|
||||
|
||||
New-Item -Path "$ModuleHKCURegistryPath" -Force -ErrorVariable Error -ErrorAction Stop | Out-Null
|
||||
New-ItemProperty -Path "$ModuleHKCURegistryPath" -Name ModuleSourcePath -Value $ModuleSourcePath -ErrorAction Stop | Out-Null
|
||||
$env:PSModulePath = $env:PSModulePath + ";" + "$ModuleSourcePath"
|
||||
|
||||
} #end try
|
||||
|
||||
Catch {
|
||||
|
||||
Write-Host $Error
|
||||
$MessageBoxBody = "Could not save ModuleSourcePath to Windows Registry! Not even to User Registry! Check your access rights! Exiting now.."
|
||||
$MessageBoxTitle = "ScriptName: $ScriptName - Module/Section: Load-PowerShellModule"
|
||||
$MessageBoxButtonType = "OK"
|
||||
$MessageBoxIcon = "Warning"
|
||||
$MessageBox = [Windows.Forms.MessageBox]::Show($MessageBoxBody,$MessageBoxTitle,$MessageBoxButtonType,$MessageBoxIcon)
|
||||
exit
|
||||
|
||||
} #end catch
|
||||
|
||||
} #end if
|
||||
|
||||
ELSEIF ($PathTest -eq $True) {
|
||||
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Registry Key seems to exist."
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Trying to write ModuleSourcepath to HKCU."
|
||||
|
||||
Try {
|
||||
|
||||
Set-ItemProperty -Path "$ModuleHKCURegistryPath" -Name ModuleSourcePath -Value $ModuleSourcePath -ErrorVariable Error -ErrorAction Stop | Out-Null
|
||||
|
||||
} #end try
|
||||
|
||||
Catch {
|
||||
|
||||
Write-Host $Error
|
||||
$MessageBoxBody = "Could not save ModuleSourcePath to Windows Registry! Not even to User Registry! Check your access rights! Exiting now.."
|
||||
$MessageBoxTitle = "ScriptName: $ScriptName - Module/Section: Load-PowerShellModule"
|
||||
$MessageBoxButtonType = "OK"
|
||||
$MessageBoxIcon = "Warning"
|
||||
$MessageBox = [Windows.Forms.MessageBox]::Show($MessageBoxBody,$MessageBoxTitle,$MessageBoxButtonType,$MessageBoxIcon)
|
||||
exit
|
||||
|
||||
} #end catch
|
||||
|
||||
} #end elseif
|
||||
|
||||
ELSE {
|
||||
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Something went wrong, by getting the ModuleSourcePath!"
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Exiting Script, because of this!"
|
||||
exit
|
||||
|
||||
} #end else
|
||||
|
||||
} #end if
|
||||
|
||||
} #end if
|
||||
|
||||
ELSE {
|
||||
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: You choose, not to save the ModuleSourcePath to the Windows Registry!"
|
||||
|
||||
$MessageBoxBody = "You choose, not to save the ModuleSourcePath to the Windows Registry!"
|
||||
$MessageBoxTitle = "ScriptName: $ScriptName - Module/Section: Load-PowerShellModule"
|
||||
$MessageBoxButtonType = "OK"
|
||||
$MessageBoxIcon = "Warning"
|
||||
$MessageBox = [Windows.Forms.MessageBox]::Show($MessageBoxBody,$MessageBoxTitle,$MessageBoxButtonType,$MessageBoxIcon)
|
||||
|
||||
} #end else
|
||||
|
||||
} #end if
|
||||
|
||||
ELSE {
|
||||
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Something went wrong, by getting the ModuleSourcePath!"
|
||||
Write-Host "DEBUG Info - Load-PowerShellModule: Exiting Script, because of this!"
|
||||
exit
|
||||
|
||||
} #end else
|
||||
|
||||
} #end else
|
||||
|
||||
} #end else
|
||||
|
||||
} #end process
|
||||
|
||||
} #end function
|
||||
|
||||
#-----------------------------------------------------------------------------------------------------#
|
||||
########################################### preparing part ############################################
|
||||
#-----------------------------------------------------------------------------------------------------#
|
||||
|
||||
#Clear Console Content
|
||||
Clear-Host
|
||||
|
||||
#Load external Modules - use Force ( -Force) Parameter, to reload in every run
|
||||
Load-PowerShellModule -ModuleName Write-LogFile -Force
|
||||
Load-PowerShellModule -ModuleName Read-ConfigFile -Force
|
||||
Load-PowerShellModule -ModuleName Remove-Item-withLogging -Force
|
||||
Load-PowerShellModule -ModuleName Start-windreamSession-withLogging -Force
|
||||
Load-PowerShellModule -ModuleName Restart-windreamClient-withLogging -Force
|
||||
|
||||
#Read ConfigFile, to get all values
|
||||
Set-Variable -Name ConfigValues -Value (Read-ConfigFile -ConfigFile $ConfigFile) -Force -Scope Global
|
||||
|
||||
#Allocate Variable Values, depending on the read ConfigFile
|
||||
Set-Variable -Name LogPaths -Value (Read-ConfigFile -ConfigLabel LogPath) -Force -Scope Global
|
||||
Set-Variable -Name LogFileKeepTime -Value (Read-ConfigFile -ConfigLabel LogFileKeepTime) -Force -Scope Global
|
||||
Set-Variable -Name windreamRestartTrys -Value (Read-ConfigFile -ConfigLabel windreamRestartTrys) -Force -Scope Global
|
||||
Set-Variable -Name windreamServer -Value (Read-ConfigFile -ConfigLabel windreamServer) -Force -Scope Global
|
||||
Set-Variable -Name windreamDomain -Value (Read-ConfigFile -ConfigLabel windreamDomain) -Force -Scope Global
|
||||
Set-Variable -Name windreamUserName -Value (Read-ConfigFile -ConfigLabel windreamUserName) -Force -Scope Global
|
||||
Set-Variable -Name windreamUserPassword -Value (Read-ConfigFile -ConfigLabel windreamUserPassword) -Force -Scope Global
|
||||
|
||||
#-----------------------------------------------------------------------------------------------------#
|
||||
############################################# main part ###############################################
|
||||
#-----------------------------------------------------------------------------------------------------#
|
||||
|
||||
Write-Logfile -LogLine " "
|
||||
Write-Logfile -LogLine "********************************************************************************"
|
||||
Write-Logfile -LogLine "Program Startup: $ScriptName on $env:computername,"
|
||||
Write-Logfile -LogLine "from Account $env:USERDOMAIN\$env:USERNAME."
|
||||
Write-Logfile -LogLine "********************************************************************************"
|
||||
|
||||
DO {
|
||||
|
||||
Write-Logfile -LogLine " "
|
||||
Write-Logfile -LogLine "--------------------------------------------------------------------------------"
|
||||
Write-Logfile -LogLine "Testing for windream availability."
|
||||
Write-Logfile -LogLine "--------------------------------------------------------------------------------"
|
||||
|
||||
$windreamPathTest = Test-Path -Path "\\windream\objects" -PathType Container -ErrorAction SilentlyContinue
|
||||
$windreamSession = Start-windreamSession-withLogging
|
||||
|
||||
IF (($windreamSession.aLoggedin -eq $True) -and ($windreamPathTest -eq $True)) {
|
||||
|
||||
Write-Logfile -LogLine " "
|
||||
Write-Logfile -LogLine "Availability Test seems to be ok!"
|
||||
Write-Logfile -LogLine "windream seems to be available from this station,"
|
||||
Write-Logfile -LogLine "no further actions required!"
|
||||
|
||||
} #end if
|
||||
|
||||
ELSE {
|
||||
|
||||
[int]$Counter1++
|
||||
Write-Logfile -LogLine " "
|
||||
Write-Logfile -LogLine "--------------------------------------------------------------------------------"
|
||||
Write-Logfile -LogLine "Availability Test failed!"
|
||||
Write-Logfile -LogLine "--------------------------------------------------------------------------------"
|
||||
Write-Logfile -LogLine "windream Drive $($windreamDriveLetter) Test (True = Drive available, False = Drive unavailable): $windreamPathTest"
|
||||
Write-Logfile -LogLine "windream Session Test (True = Session OK, False = Session not OK): $($windreamSession.aLoggedin)"
|
||||
Write-Logfile -LogLine ""
|
||||
Write-Logfile -LogLine "Trying to fix the Problem. This is Try: $Counter1 out of $windreamRestartTrys"
|
||||
$windreamClientRestart = Restart-windreamClient-withLogging
|
||||
|
||||
} #end else
|
||||
|
||||
} #end do
|
||||
|
||||
UNTIL ((($windreamSession.aLoggedin -eq $True) -and ($windreamPathTest -eq $True)) -or ($Counter1 -eq $windreamRestartTrys))
|
||||
|
||||
#If windream Session was established and Path Test was successful
|
||||
IF (($windreamSession.aLoggedin -eq $True) -and ($windreamPathTest -eq $True)) {
|
||||
|
||||
IF ($argOperationMode -like "interactive") {
|
||||
|
||||
Write-Host "DEBUG Info: Showing MSGBox, after successfull Connection Test."
|
||||
|
||||
IF ($Counter1 -lt 1) {
|
||||
|
||||
$MessageBoxBody = "No windream Restart Try(s) needed, windream is still working!"
|
||||
|
||||
} #end if
|
||||
|
||||
ELSEIF (($Counter1 -eq 1) -or ($Counter1 -gt 1)) {
|
||||
|
||||
$MessageBoxBody = "After $Counter1 windream Restart Try(s), windream is now working again!"
|
||||
|
||||
} #end elseif
|
||||
|
||||
ELSE {
|
||||
|
||||
$MessageBoxBody = "Its seems I have Dyscalculia, but windream is working, so everything is alright!"
|
||||
|
||||
} #end else
|
||||
|
||||
$MessageBoxTitle = "ScriptName: $ScriptName - Module/Section: Connection Test"
|
||||
$MessageBoxButtonType = "OK"
|
||||
$MessageBoxIcon = "Information"
|
||||
$MessageBox = [Windows.Forms.MessageBox]::Show($MessageBoxBody,$MessageBoxTitle,$MessageBoxButtonType,$MessageBoxIcon) | Out-Null
|
||||
|
||||
} #end if
|
||||
|
||||
Try {
|
||||
|
||||
Write-Host "DEBUG Info: Logout windream Session."
|
||||
$windreamSession.Logout()
|
||||
|
||||
} #end try
|
||||
|
||||
Catch {
|
||||
|
||||
Write-Logfile -LogLine " "
|
||||
Write-LogFile -LogLine "Cannot Logout from windream Session!"
|
||||
Write-Logfile -LogLine "Unexpected Error!"
|
||||
Write-Logfile -LogLine $Error
|
||||
|
||||
} #end catch
|
||||
|
||||
} #end if
|
||||
|
||||
ELSE {
|
||||
|
||||
IF ($argOperationMode -like "interactive") {
|
||||
|
||||
Write-Host "DEBUG Info: Showing MSGBox, after unsuccessfull Connection Test."
|
||||
|
||||
IF ($Counter1 -lt 1) {
|
||||
|
||||
$MessageBoxBody = "No windream Restart Try(s) possible, windream is still not working!"+"`r`n"+"Please contact your Administrator!"+"`r`n"+"`r`n"+"He should check the LogFile:"+"`r`n"+"$LogPath\$LogFile"
|
||||
|
||||
} #end if
|
||||
|
||||
ELSEIF (($Counter1 -eq 1) -or ($Counter1 -gt 1)) {
|
||||
|
||||
$MessageBoxBody = "After $Counter1 windream Restart Try(s), windream is still not working!"+"`r`n"+"Please contact your Administrator!"+"`r`n"+"`r`n"+"He should check the LogFile:"+"`r`n"+"$LogPath\$LogFile"
|
||||
|
||||
} #end elseif
|
||||
|
||||
ELSE {
|
||||
|
||||
$MessageBoxBody = "Its seems I have Dyscalculia, but windream is not working, so nothing is alright!"+"`r`n"+"Please contact your Administrator!"+"`r`n"+"`r`n"+"He should check the LogFile:"+"`r`n"+"$LogPath\$LogFile"
|
||||
|
||||
} #end else
|
||||
|
||||
$MessageBoxTitle = "ScriptName: $ScriptName - Module/Section: Connection Test"
|
||||
$MessageBoxButtonType = "OK"
|
||||
$MessageBoxIcon = "Error"
|
||||
$MessageBox = [Windows.Forms.MessageBox]::Show($MessageBoxBody,$MessageBoxTitle,$MessageBoxButtonType,$MessageBoxIcon) | Out-Null
|
||||
|
||||
} #end if
|
||||
|
||||
} #end else
|
||||
|
||||
Write-Logfile -LogLine " "
|
||||
Write-Logfile -LogLine "--------------------------------------------------------------------------------"
|
||||
Write-Logfile -LogLine "Checking for old LogFiles."
|
||||
Write-Logfile -LogLine "--------------------------------------------------------------------------------"
|
||||
|
||||
Remove-Item-withLogging -Path $LogPath -FileKeepTime $LogFileKeepTime -FileBaseName $ScriptName
|
||||
|
||||
Write-Logfile -LogLine " "
|
||||
Write-Logfile -LogLine "********************************************************************************"
|
||||
Write-Logfile -LogLine "Program Completed: $ScriptName on $env:computername,"
|
||||
Write-Logfile -LogLine "from Account $env:USERDOMAIN\$env:USERNAME."
|
||||
Write-Logfile -LogLine "********************************************************************************"
|
||||
|
||||
#-----------------------------------------------------------------------------------------------------#
|
||||
########################################### finishing part ############################################
|
||||
#-----------------------------------------------------------------------------------------------------#
|
||||
|
||||
Remove-Variable -Name ScriptName -Force -ErrorAction SilentlyContinue
|
||||
Remove-Variable -Name ScriptPath -Force -ErrorAction SilentlyContinue
|
||||
Remove-Variable -Name ConfigFile -Force -ErrorAction SilentlyContinue
|
||||
Remove-Variable -Name ConfigValues -Force -ErrorAction SilentlyContinue
|
||||
Remove-Variable -Name Timestamp1 -Force -ErrorAction SilentlyContinue
|
||||
Remove-Variable -Name Timestamp2 -Force -ErrorAction SilentlyContinue
|
||||
Remove-Variable -Name Timestamp3 -Force -ErrorAction SilentlyContinue
|
||||
Remove-Variable -Name Timestamp4 -Force -ErrorAction SilentlyContinue
|
||||
Remove-Variable -Name Counter1 -Force -ErrorAction SilentlyContinue
|
||||
Remove-Variable -Name LogFile -Force -ErrorAction SilentlyContinue
|
||||
Remove-Variable -Name LogFileKeepTime -Force -ErrorAction SilentlyContinue
|
||||
Remove-Variable -Name LogLine -Force -ErrorAction SilentlyContinue
|
||||
Remove-Variable -Name LogPath -Force -ErrorAction SilentlyContinue
|
||||
Remove-Variable -Name LogPaths -Force -ErrorAction SilentlyContinue
|
||||
Remove-Variable -Name ModuleOverrideSourcePath -Force -ErrorAction SilentlyContinue
|
||||
Remove-Variable -Name ModuleDefaultSourcePath -Force -ErrorAction SilentlyContinue
|
||||
Remove-Variable -Name ModuleHKLMRegistryPath -Force -ErrorAction SilentlyContinue
|
||||
Remove-Variable -Name ModuleHKCURegistryPath -Force -ErrorAction SilentlyContinue
|
||||
|
||||
Remove-Variable -Name Item -Force -ErrorAction SilentlyContinue
|
||||
Remove-Variable -Name Items -Force -ErrorAction SilentlyContinue
|
||||
Remove-Variable -Name MessageBoxBody -Force -ErrorAction SilentlyContinue
|
||||
Remove-Variable -Name MessageBoxTitle -Force -ErrorAction SilentlyContinue
|
||||
Remove-Variable -Name MessageBoxButtonType -Force -ErrorAction SilentlyContinue
|
||||
Remove-Variable -Name MessageBoxIcon -Force -ErrorAction SilentlyContinue
|
||||
Remove-Variable -Name MessageBox -Force -ErrorAction SilentlyContinue
|
||||
|
||||
Remove-Variable -Name windreamPathTest -Force -ErrorAction SilentlyContinue
|
||||
Remove-Variable -Name windreamSession -Force -ErrorAction SilentlyContinue
|
||||
Remove-Variable -Name windreamRestartTrys -Force -ErrorAction SilentlyContinue
|
||||
Remove-Variable -Name WMEntityDocumentAndMap -Force -ErrorAction SilentlyContinue
|
||||
Remove-Variable -Name WMEntityDocument -Force -ErrorAction SilentlyContinue
|
||||
Remove-Variable -Name WMEntityFolder -Force -ErrorAction SilentlyContinue
|
||||
|
||||
$error.clear()
|
||||
Binary file not shown.
@@ -0,0 +1,20 @@
|
||||
Version 1.1.0.0 - 25.11.2016
|
||||
NEW: -
|
||||
FIX: -
|
||||
CHG: -
|
||||
REM: -
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Version 1.0.0.0 - 21.11.2016
|
||||
NEW: -
|
||||
FIX: -
|
||||
CHG: -
|
||||
REM: -
|
||||
|
||||
-------------------------------------legend------------------------------------
|
||||
NEW: = Added a new functionality
|
||||
FIX: = Fixed a Issue with existing functionality
|
||||
CHG: = Changed a existing functionality
|
||||
REM: = Removed a existing functionality
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -0,0 +1,62 @@
|
||||
####################################################################################################
|
||||
# Digital Data Configuration File (Template Date: 30.07.2016) #
|
||||
# UTF-8 Coding required! #
|
||||
# incl. FailSafe functions that are active when information is missing. #
|
||||
####################################################################################################
|
||||
|
||||
#==================================================================================================#
|
||||
########################################## General Setup ###########################################
|
||||
#==================================================================================================#
|
||||
|
||||
####################################################################################################
|
||||
# Path in which the log files will be stored. #
|
||||
# Example: E:\LogFiles\<ScriptName> #
|
||||
# FailSafe Setting is: <ScriptPath> #
|
||||
####################################################################################################
|
||||
LogPath =
|
||||
|
||||
####################################################################################################
|
||||
# Numerical value how long (in days) log files will be kept. ValidateRange is 0 - 1000 #
|
||||
# Value of 0 disables the delete function completely. #
|
||||
# FailSafe Setting is: 60 #
|
||||
####################################################################################################
|
||||
LogFileKeepTime = 3
|
||||
|
||||
####################################################################################################
|
||||
# Numerical value how many Reconnect Trys will be done if windream Connection is lost. #
|
||||
# Example: 10 #
|
||||
# FailSafe Setting is: 5 #
|
||||
####################################################################################################
|
||||
windreamRestartTrys = 10
|
||||
|
||||
#==================================================================================================#
|
||||
########################################## Impersonation ###########################################
|
||||
#==================================================================================================#
|
||||
|
||||
####################################################################################################
|
||||
# To use the windream Impersonation Login Methode, you have to set the windream Server Name. #
|
||||
# For Impersonation Login all four Settings must be set, otherwise Standard Login will be used. #
|
||||
# Example: windream-DB01 #
|
||||
####################################################################################################
|
||||
windreamServer =
|
||||
|
||||
####################################################################################################
|
||||
# To use the windream Impersonation Login Methode, you have to set the Windows Domain. #
|
||||
# For Impersonation Login all four Settings must be set, otherwise Standard Login will be used. #
|
||||
# Example: WindowsDomain.local #
|
||||
####################################################################################################
|
||||
windreamDomain =
|
||||
|
||||
####################################################################################################
|
||||
# To use the windream Impersonation Login Methode, you have to set the windream User Name. #
|
||||
# For Impersonation Login all four Settings must be set, otherwise Standard Login will be used. #
|
||||
# Example: UserName #
|
||||
####################################################################################################
|
||||
windreamUserName =
|
||||
|
||||
####################################################################################################
|
||||
# To use the windream Impersonation Login Methode, you have to set the windream User Password. #
|
||||
# For Impersonation Login all four Settings must be set, otherwise Standard Login will be used. #
|
||||
# Example: UserPassword #
|
||||
####################################################################################################
|
||||
windreamUserPassword =
|
||||
@@ -0,0 +1,45 @@
|
||||
@ECHO OFF
|
||||
TITLE DIGITAL DATA - Run all files in directory with current permissions
|
||||
ECHO -
|
||||
ECHO Batch Script
|
||||
ECHO Run all files in directory with current permissions
|
||||
ECHO -
|
||||
ECHO Digital Data
|
||||
ECHO Ludwig-Rinn-Strasse 16
|
||||
ECHO 35452 Heuchelheim
|
||||
ECHO Tel.: 0641 / 202360
|
||||
ECHO E-Mail: info@didalog.de
|
||||
ECHO -
|
||||
ECHO Version 1.0.0.0
|
||||
ECHO Date: 13.08.2015
|
||||
ECHO -
|
||||
ECHO Program Startup %date% at %time:~0,8% oclock, on %computername%.
|
||||
|
||||
REM --------------------------------------------------------------
|
||||
REM ------------------------set variables-------------------------
|
||||
REM --------------------------------------------------------------
|
||||
|
||||
setlocal enableextensions
|
||||
|
||||
SET DIRECTORY="%cd%"
|
||||
SET FILEEXTENSION=*.ps1
|
||||
SET COUNT=0
|
||||
|
||||
REM --------------------------------------------------------------
|
||||
REM ---------------------Program 1 / Script 1---------------------
|
||||
REM --------------------------------------------------------------
|
||||
|
||||
FOR /F "tokens=*" %%f in ('dir /S /b %FILEEXTENSION%') do (ECHO %%f && set /a count+=1)
|
||||
ECHO -
|
||||
ECHO Found %count% File(s) with File Extension %FILEEXTENSION% in Directory:
|
||||
ECHO %DIRECTORY%.
|
||||
|
||||
ECHO -
|
||||
ECHO Running this/them now, with your permissions!
|
||||
FOR /F "tokens=*" %%f in ('dir /S /b %FILEEXTENSION%') do (PowerShell.exe -Command "& {Start-Process PowerShell.exe -WindowStyle hidden '-ExecutionPolicy Bypass -File "%%f"'}")
|
||||
|
||||
ECHO -
|
||||
ECHO This Window will close in:
|
||||
#timeout /T 10
|
||||
endlocal
|
||||
exit
|
||||
@@ -0,0 +1,45 @@
|
||||
@ECHO OFF
|
||||
TITLE DIGITAL DATA - Run all files in directory with current permissions
|
||||
ECHO -
|
||||
ECHO Batch Script
|
||||
ECHO Run all files in directory with current permissions
|
||||
ECHO -
|
||||
ECHO Digital Data
|
||||
ECHO Ludwig-Rinn-Strasse 16
|
||||
ECHO 35452 Heuchelheim
|
||||
ECHO Tel.: 0641 / 202360
|
||||
ECHO E-Mail: info@didalog.de
|
||||
ECHO -
|
||||
ECHO Version 1.0.0.0
|
||||
ECHO Date: 13.08.2015
|
||||
ECHO -
|
||||
ECHO Program Startup %date% at %time:~0,8% oclock, on %computername%.
|
||||
|
||||
REM --------------------------------------------------------------
|
||||
REM ------------------------set variables-------------------------
|
||||
REM --------------------------------------------------------------
|
||||
|
||||
setlocal enableextensions
|
||||
|
||||
SET DIRECTORY="%cd%"
|
||||
SET FILEEXTENSION=*.ps1
|
||||
SET COUNT=0
|
||||
|
||||
REM --------------------------------------------------------------
|
||||
REM ---------------------Program 1 / Script 1---------------------
|
||||
REM --------------------------------------------------------------
|
||||
|
||||
FOR /F "tokens=*" %%f in ('dir /S /b %FILEEXTENSION%') do (ECHO %%f && set /a count+=1)
|
||||
ECHO -
|
||||
ECHO Found %count% File(s) with File Extension %FILEEXTENSION% in Directory:
|
||||
ECHO %DIRECTORY%.
|
||||
|
||||
ECHO -
|
||||
ECHO Running this/them now, with your permissions!
|
||||
FOR /F "tokens=*" %%f in ('dir /S /b %FILEEXTENSION%') do (PowerShell.exe -Command "& {Start-Process PowerShell.exe -WindowStyle hidden '-ExecutionPolicy Bypass -File "%%f" -argOperationMode "interactive"'}")
|
||||
|
||||
ECHO -
|
||||
ECHO This Window will close in:
|
||||
#timeout /T 10
|
||||
endlocal
|
||||
exit
|
||||
@@ -0,0 +1,41 @@
|
||||
#PowerShell Data File
|
||||
#Language Data File for "Test-windreamConnectivity" Script
|
||||
#Language: de-de | UTF8 coded!
|
||||
|
||||
#Digital Data
|
||||
#Ludwig-Rinn-Strasse 16
|
||||
#35452 Heuchelheim
|
||||
#Tel.: 0641 / 202360
|
||||
#E-Mail: info@didalog.de
|
||||
|
||||
#Version Number: 1.0.0.0
|
||||
#Version Date: 04.01.2017
|
||||
|
||||
ConvertFrom-StringData @"
|
||||
|
||||
MessageBoxBody1_1=Möchten Sie prüfen lassen, ob die Verbindung zu windream funktioniert?
|
||||
MessageBoxBody1_2=Sollte dieser Test fehlschlagen, wird automatisch versucht die Verbindung wiederherzustellen (
|
||||
MessageBoxBody1_3=Versuch(e) insgesamt).
|
||||
MessageBoxTitle1_1=ScriptName:
|
||||
MessageBoxTitle1_2=- Module/Section: pre Connection Test
|
||||
|
||||
MessageBoxBody2_1=Die Verbindung muss nicht wiederhergestellt werden, sie besteht bereits!
|
||||
MessageBoxBody3_1=Nach
|
||||
MessageBoxBody3_2=Wiederherstellungsversuch(en), ist windream wieder erreichbar!
|
||||
MessageBoxBody4_1=Der Zähler für die Wiederherstellungsversuche funktioniert nicht, aber windream wieder erreichbar!
|
||||
MessageBoxTitle2_1=ScriptName:
|
||||
MessageBoxTitle2_2=- Module/Section: Connection Test
|
||||
|
||||
MessageBoxBody5_1=Wiederherstellungsversuch ist fehlgeschlagen, windream ist nach wie vor nicht erreichbar!
|
||||
MessageBoxBody5_2=Bitte wenden Sie sich an Ihren Administrator!
|
||||
MessageBoxBody5_3=Dieser sollte folgende Log-Datei prüfen:
|
||||
MessageBoxBody6_1=Nach
|
||||
MessageBoxBody6_2=Wiederherstellungsversuch(en), ist windream immer noch nicht erreichbar!
|
||||
MessageBoxBody6_3=Bitte wenden Sie sich an Ihren Administrator!
|
||||
MessageBoxBody6_4=Dieser sollte folgende Log-Datei prüfen:
|
||||
MessageBoxBody7_1=Der Zähler für die Wiederherstellungsversuche funktioniert nicht, windream ist nach wie vor nicht erreichbar!
|
||||
MessageBoxBody7_2=Bitte wenden Sie sich an Ihren Administrator!
|
||||
MessageBoxBody7_3=Dieser sollte folgende Log-Datei prüfen:
|
||||
MessageBoxTitle3_1=ScriptName:
|
||||
MessageBoxTitle3_2=- Module/Section: Connection Test
|
||||
"@
|
||||
@@ -0,0 +1,41 @@
|
||||
#PowerShell Data File
|
||||
#Language Data File for "Test-windreamConnectivity" Script
|
||||
#Language: nl-nl
|
||||
|
||||
#Digital Data
|
||||
#Ludwig-Rinn-Strasse 16
|
||||
#35452 Heuchelheim
|
||||
#Tel.: 0641 / 202360
|
||||
#E-Mail: info@didalog.de
|
||||
|
||||
#Version Number: 1.0.0.0
|
||||
#Version Date: 04.01.2017
|
||||
|
||||
ConvertFrom-StringData @"
|
||||
|
||||
MessageBoxBody1_1=Wil je de beschikbaarheid van windream testen?
|
||||
MessageBoxBody1_2=Als de test niet succesvol is, zal er geprobeerd worden om de windream componenten opnieuw te starten (maximaal
|
||||
MessageBoxBody1_3=pogingen).
|
||||
MessageBoxTitle1_1=ScriptName:
|
||||
MessageBoxTitle1_2=- Module/Section: pre Connection Test
|
||||
|
||||
MessageBoxBody2_1=Geen herstart poging(en) benodigd, windream werkt nog steeds!
|
||||
MessageBoxBody3_1=Na
|
||||
MessageBoxBody3_2=Windream herstart poging(en) werkt windream weer naar behoren!
|
||||
MessageBoxBody4_1=Het lijkt erop alsof ik Dyscalculie heb, maar Windream werkt dus alles is goed!
|
||||
MessageBoxTitle2_1=ScriptName:
|
||||
MessageBoxTitle2_2=- Module/Section: Connection Test
|
||||
|
||||
MessageBoxBody5_1=Geen windream herstart poging(en) mogelijk, windream werkt nog steeds niet!
|
||||
MessageBoxBody5_2=Contacteer de systeembeheerder voor verdere hulp!
|
||||
MessageBoxBody5_3=Hij kan de logfile bekijken:
|
||||
MessageBoxBody6_1=Na
|
||||
MessageBoxBody6_2=windream herstart poging(en) werkt windream helaas nog niet!
|
||||
MessageBoxBody6_3=Contacteer de systeembeheerder voor verdere hulp!
|
||||
MessageBoxBody6_4=Hij kan de logfile bekijken:
|
||||
MessageBoxBody7_1=Het lijkt erop alsof ik Dyscalculie heb, maar windream werkt niet dus niets is goed!
|
||||
MessageBoxBody7_2=Contacteer de systeembeheerder voor verdere hulp!
|
||||
MessageBoxBody7_3=Hij kan de logfile bekijken:
|
||||
MessageBoxTitle3_1=ScriptName:
|
||||
MessageBoxTitle3_2=- Module/Section: Connection Test
|
||||
"@
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,45 @@
|
||||
@ECHO OFF
|
||||
TITLE DIGITAL DATA - Run all files in directory with current permissions
|
||||
ECHO -
|
||||
ECHO Batch Script
|
||||
ECHO Run all files in directory with current permissions
|
||||
ECHO -
|
||||
ECHO Digital Data
|
||||
ECHO Ludwig-Rinn-Strasse 16
|
||||
ECHO 35452 Heuchelheim
|
||||
ECHO Tel.: 0641 / 202360
|
||||
ECHO E-Mail: info@didalog.de
|
||||
ECHO -
|
||||
ECHO Version 1.0.0.0
|
||||
ECHO Date: 13.08.2015
|
||||
ECHO -
|
||||
ECHO Program Startup %date% at %time:~0,8% oclock, on %computername%.
|
||||
|
||||
REM --------------------------------------------------------------
|
||||
REM ------------------------set variables-------------------------
|
||||
REM --------------------------------------------------------------
|
||||
|
||||
setlocal enableextensions
|
||||
|
||||
SET DIRECTORY="%cd%"
|
||||
SET FILEEXTENSION=*.ps1
|
||||
SET COUNT=0
|
||||
|
||||
REM --------------------------------------------------------------
|
||||
REM ---------------------Program 1 / Script 1---------------------
|
||||
REM --------------------------------------------------------------
|
||||
|
||||
FOR /F "tokens=*" %%f in ('dir /S /b %FILEEXTENSION%') do (ECHO %%f && set /a count+=1)
|
||||
ECHO -
|
||||
ECHO Found %count% File(s) with File Extension %FILEEXTENSION% in Directory:
|
||||
ECHO %DIRECTORY%.
|
||||
|
||||
ECHO -
|
||||
ECHO Running this/them now, with your permissions!
|
||||
FOR /F "tokens=*" %%f in ('dir /S /b %FILEEXTENSION%') do (PowerShell.exe -Command "& {Start-Process PowerShell.exe -WindowStyle hidden '-ExecutionPolicy Bypass -File "%%f"'}")
|
||||
|
||||
ECHO -
|
||||
ECHO This Window will close in:
|
||||
#timeout /T 10
|
||||
endlocal
|
||||
exit
|
||||
@@ -0,0 +1,39 @@
|
||||
Version 1.2.0.0 - 04.01.2017
|
||||
NEW: - Multilanguage Support (en, de, nl) for Message Boxes (only in interactive mode).
|
||||
FIX: -
|
||||
CHG: - Exception in case, no windream Client was found.
|
||||
REM: -
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Version 1.1.0.2 - 02.12.2016
|
||||
NEW: - Help text for calling this Script with a Parameter
|
||||
- New Version of Module "Start-windreamSession-withLogging" will automatically map the windream Drive,
|
||||
if not connected but configured in wmcc Server Selector.
|
||||
FIX: -
|
||||
CHG: - Script will exit, if one or more external Functions couldnt be loaded.
|
||||
REM: -
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Version 1.1.0.0 - 30.11.2016
|
||||
NEW: - Initial check (MSGBox Yes/No) whether the windream Connectivity Test,
|
||||
should be started (only in interactive mode).
|
||||
FIX: -
|
||||
CHG: -
|
||||
REM: -
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Version 1.0.0.0 - 21.11.2016
|
||||
NEW: -
|
||||
FIX: -
|
||||
CHG: -
|
||||
REM: -
|
||||
|
||||
-------------------------------------legend------------------------------------
|
||||
NEW: = Added a new functionality
|
||||
FIX: = Fixed a Issue with existing functionality
|
||||
CHG: = Changed a existing functionality
|
||||
REM: = Removed a functionality
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -0,0 +1,45 @@
|
||||
@ECHO OFF
|
||||
TITLE DIGITAL DATA - Run all files in directory with current permissions
|
||||
ECHO -
|
||||
ECHO Batch Script
|
||||
ECHO Run all files in directory with current permissions
|
||||
ECHO -
|
||||
ECHO Digital Data
|
||||
ECHO Ludwig-Rinn-Strasse 16
|
||||
ECHO 35452 Heuchelheim
|
||||
ECHO Tel.: 0641 / 202360
|
||||
ECHO E-Mail: info@didalog.de
|
||||
ECHO -
|
||||
ECHO Version 1.0.0.0
|
||||
ECHO Date: 13.08.2015
|
||||
ECHO -
|
||||
ECHO Program Startup %date% at %time:~0,8% oclock, on %computername%.
|
||||
|
||||
REM --------------------------------------------------------------
|
||||
REM ------------------------set variables-------------------------
|
||||
REM --------------------------------------------------------------
|
||||
|
||||
setlocal enableextensions
|
||||
|
||||
SET DIRECTORY="%cd%"
|
||||
SET FILEEXTENSION=*.ps1
|
||||
SET COUNT=0
|
||||
|
||||
REM --------------------------------------------------------------
|
||||
REM ---------------------Program 1 / Script 1---------------------
|
||||
REM --------------------------------------------------------------
|
||||
|
||||
FOR /F "tokens=*" %%f in ('dir /S /b %FILEEXTENSION%') do (ECHO %%f && set /a count+=1)
|
||||
ECHO -
|
||||
ECHO Found %count% File(s) with File Extension %FILEEXTENSION% in Directory:
|
||||
ECHO %DIRECTORY%.
|
||||
|
||||
ECHO -
|
||||
ECHO Running this/them now, with your permissions!
|
||||
FOR /F "tokens=*" %%f in ('dir /S /b %FILEEXTENSION%') do (PowerShell.exe -Command "& {Start-Process PowerShell.exe -WindowStyle hidden '-ExecutionPolicy Bypass -File "%%f" -argOperationMode "interactive"'}")
|
||||
|
||||
ECHO -
|
||||
ECHO This Window will close in:
|
||||
#timeout /T 10
|
||||
endlocal
|
||||
exit
|
||||
@@ -0,0 +1,70 @@
|
||||
####################################################################################################
|
||||
# Digital Data Configuration File (Template Date: 30.07.2016) #
|
||||
# UTF-8 Coding required! #
|
||||
# incl. FailSafe functions that are active when information is missing. #
|
||||
####################################################################################################
|
||||
|
||||
#==================================================================================================#
|
||||
########################################## General Setup ###########################################
|
||||
#==================================================================================================#
|
||||
|
||||
####################################################################################################
|
||||
# Path in which the log files will be stored. #
|
||||
# Example: E:\LogFiles\<ScriptName> #
|
||||
# FailSafe Setting is: <ScriptPath> #
|
||||
####################################################################################################
|
||||
LogPath =
|
||||
|
||||
####################################################################################################
|
||||
# Numerical value how long (in days) log files will be kept. ValidateRange is 0 - 1000 #
|
||||
# Value of 0 disables the delete function completely. #
|
||||
# FailSafe Setting is: 60 #
|
||||
####################################################################################################
|
||||
LogFileKeepTime = 3
|
||||
|
||||
####################################################################################################
|
||||
# Set the User Interface Language. Please check for existing .psd1 File in the Localized Subfolder.#
|
||||
# If you did not set this Option, Script will retrive the current Language itself. #
|
||||
# Example: de-de #
|
||||
# FailSafe Setting is: en-us #
|
||||
####################################################################################################
|
||||
UICultureForce =
|
||||
|
||||
####################################################################################################
|
||||
# Numerical value how many Reconnect Trys will be done if windream Connection is lost. #
|
||||
# Example: 10 #
|
||||
# FailSafe Setting is: 5 #
|
||||
####################################################################################################
|
||||
windreamClientRestartTrys = 10
|
||||
|
||||
#==================================================================================================#
|
||||
########################################## Impersonation ###########################################
|
||||
#==================================================================================================#
|
||||
|
||||
####################################################################################################
|
||||
# To use the windream Impersonation Login Methode, you have to set the windream Server Name. #
|
||||
# For Impersonation Login all four Settings must be set, otherwise Standard Login will be used. #
|
||||
# Example: windream-DB01 #
|
||||
####################################################################################################
|
||||
windreamServer =
|
||||
|
||||
####################################################################################################
|
||||
# To use the windream Impersonation Login Methode, you have to set the Windows Domain. #
|
||||
# For Impersonation Login all four Settings must be set, otherwise Standard Login will be used. #
|
||||
# Example: WindowsDomain.local #
|
||||
####################################################################################################
|
||||
windreamDomain =
|
||||
|
||||
####################################################################################################
|
||||
# To use the windream Impersonation Login Methode, you have to set the windream User Name. #
|
||||
# For Impersonation Login all four Settings must be set, otherwise Standard Login will be used. #
|
||||
# Example: UserName #
|
||||
####################################################################################################
|
||||
windreamUserName =
|
||||
|
||||
####################################################################################################
|
||||
# To use the windream Impersonation Login Methode, you have to set the windream User Password. #
|
||||
# For Impersonation Login all four Settings must be set, otherwise Standard Login will be used. #
|
||||
# Example: UserPassword #
|
||||
####################################################################################################
|
||||
windreamUserPassword =
|
||||
Binary file not shown.
@@ -0,0 +1,41 @@
|
||||
#PowerShell Data File
|
||||
#Language Data File for "Test-windreamConnectivity" Script
|
||||
#Language: de-de | UTF8 coded!
|
||||
|
||||
#Digital Data
|
||||
#Ludwig-Rinn-Strasse 16
|
||||
#35452 Heuchelheim
|
||||
#Tel.: 0641 / 202360
|
||||
#E-Mail: info@didalog.de
|
||||
|
||||
#Version Number: 1.0.0.0
|
||||
#Version Date: 04.01.2017
|
||||
|
||||
ConvertFrom-StringData @"
|
||||
|
||||
MessageBoxBody1_1=Möchten Sie prüfen lassen, ob die Verbindung zu windream funktioniert?
|
||||
MessageBoxBody1_2=Sollte dieser Test fehlschlagen, wird automatisch versucht die Verbindung wiederherzustellen (
|
||||
MessageBoxBody1_3=Versuch(e) insgesamt).
|
||||
MessageBoxTitle1_1=ScriptName:
|
||||
MessageBoxTitle1_2=- Module/Section: pre Connection Test
|
||||
|
||||
MessageBoxBody2_1=Die Verbindung muss nicht wiederhergestellt werden, sie besteht bereits!
|
||||
MessageBoxBody3_1=Nach
|
||||
MessageBoxBody3_2=Wiederherstellungsversuch(en), ist windream wieder erreichbar!
|
||||
MessageBoxBody4_1=Der Zähler für die Wiederherstellungsversuche funktioniert nicht, aber windream wieder erreichbar!
|
||||
MessageBoxTitle2_1=ScriptName:
|
||||
MessageBoxTitle2_2=- Module/Section: Connection Test
|
||||
|
||||
MessageBoxBody5_1=Wiederherstellungsversuch ist fehlgeschlagen, windream ist nach wie vor nicht erreichbar!
|
||||
MessageBoxBody5_2=Bitte wenden Sie sich an Ihren Administrator!
|
||||
MessageBoxBody5_3=Dieser sollte folgende Log-Datei prüfen:
|
||||
MessageBoxBody6_1=Nach
|
||||
MessageBoxBody6_2=Wiederherstellungsversuch(en), ist windream immer noch nicht erreichbar!
|
||||
MessageBoxBody6_3=Bitte wenden Sie sich an Ihren Administrator!
|
||||
MessageBoxBody6_4=Dieser sollte folgende Log-Datei prüfen:
|
||||
MessageBoxBody7_1=Der Zähler für die Wiederherstellungsversuche funktioniert nicht, windream ist nach wie vor nicht erreichbar!
|
||||
MessageBoxBody7_2=Bitte wenden Sie sich an Ihren Administrator!
|
||||
MessageBoxBody7_3=Dieser sollte folgende Log-Datei prüfen:
|
||||
MessageBoxTitle3_1=ScriptName:
|
||||
MessageBoxTitle3_2=- Module/Section: Connection Test
|
||||
"@
|
||||
@@ -0,0 +1,41 @@
|
||||
#PowerShell Data File
|
||||
#Language Data File for "Test-windreamConnectivity" Script
|
||||
#Language: nl-nl
|
||||
|
||||
#Digital Data
|
||||
#Ludwig-Rinn-Strasse 16
|
||||
#35452 Heuchelheim
|
||||
#Tel.: 0641 / 202360
|
||||
#E-Mail: info@didalog.de
|
||||
|
||||
#Version Number: 1.0.0.0
|
||||
#Version Date: 04.01.2017
|
||||
|
||||
ConvertFrom-StringData @"
|
||||
|
||||
MessageBoxBody1_1=Wil je de beschikbaarheid van windream testen?
|
||||
MessageBoxBody1_2=Als de test niet succesvol is, zal er geprobeerd worden om de windream componenten opnieuw te starten (maximaal
|
||||
MessageBoxBody1_3=pogingen).
|
||||
MessageBoxTitle1_1=ScriptName:
|
||||
MessageBoxTitle1_2=- Module/Section: pre Connection Test
|
||||
|
||||
MessageBoxBody2_1=Geen herstart poging(en) benodigd, windream werkt nog steeds!
|
||||
MessageBoxBody3_1=Na
|
||||
MessageBoxBody3_2=Windream herstart poging(en) werkt windream weer naar behoren!
|
||||
MessageBoxBody4_1=Het lijkt erop alsof ik Dyscalculie heb, maar Windream werkt dus alles is goed!
|
||||
MessageBoxTitle2_1=ScriptName:
|
||||
MessageBoxTitle2_2=- Module/Section: Connection Test
|
||||
|
||||
MessageBoxBody5_1=Geen windream herstart poging(en) mogelijk, windream werkt nog steeds niet!
|
||||
MessageBoxBody5_2=Contacteer de systeembeheerder voor verdere hulp!
|
||||
MessageBoxBody5_3=Hij kan de logfile bekijken:
|
||||
MessageBoxBody6_1=Na
|
||||
MessageBoxBody6_2=windream herstart poging(en) werkt windream helaas nog niet!
|
||||
MessageBoxBody6_3=Contacteer de systeembeheerder voor verdere hulp!
|
||||
MessageBoxBody6_4=Hij kan de logfile bekijken:
|
||||
MessageBoxBody7_1=Het lijkt erop alsof ik Dyscalculie heb, maar windream werkt niet dus niets is goed!
|
||||
MessageBoxBody7_2=Contacteer de systeembeheerder voor verdere hulp!
|
||||
MessageBoxBody7_3=Hij kan de logfile bekijken:
|
||||
MessageBoxTitle3_1=ScriptName:
|
||||
MessageBoxTitle3_2=- Module/Section: Connection Test
|
||||
"@
|
||||
1043
archive/Test-windreamConnectivity/Test-windreamConnectivity.ps1
Normal file
1043
archive/Test-windreamConnectivity/Test-windreamConnectivity.ps1
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,45 @@
|
||||
@ECHO OFF
|
||||
TITLE DIGITAL DATA - Run all files in directory with current permissions
|
||||
ECHO -
|
||||
ECHO Batch Script
|
||||
ECHO Run all files in directory with current permissions
|
||||
ECHO -
|
||||
ECHO Digital Data
|
||||
ECHO Ludwig-Rinn-Strasse 16
|
||||
ECHO 35452 Heuchelheim
|
||||
ECHO Tel.: 0641 / 202360
|
||||
ECHO E-Mail: info@didalog.de
|
||||
ECHO -
|
||||
ECHO Version 1.0.0.0
|
||||
ECHO Date: 13.08.2015
|
||||
ECHO -
|
||||
ECHO Program Startup %date% at %time:~0,8% oclock, on %computername%.
|
||||
|
||||
REM --------------------------------------------------------------
|
||||
REM ------------------------set variables-------------------------
|
||||
REM --------------------------------------------------------------
|
||||
|
||||
setlocal enableextensions
|
||||
|
||||
SET DIRECTORY="%cd%"
|
||||
SET FILEEXTENSION=*.ps1
|
||||
SET COUNT=0
|
||||
|
||||
REM --------------------------------------------------------------
|
||||
REM ---------------------Program 1 / Script 1---------------------
|
||||
REM --------------------------------------------------------------
|
||||
|
||||
FOR /F "tokens=*" %%f in ('dir /S /b %FILEEXTENSION%') do (ECHO %%f && set /a count+=1)
|
||||
ECHO -
|
||||
ECHO Found %count% File(s) with File Extension %FILEEXTENSION% in Directory:
|
||||
ECHO %DIRECTORY%.
|
||||
|
||||
ECHO -
|
||||
ECHO Running this/them now, with your permissions!
|
||||
FOR /F "tokens=*" %%f in ('dir /S /b %FILEEXTENSION%') do (PowerShell.exe -Command "& {Start-Process PowerShell.exe -WindowStyle hidden '-ExecutionPolicy Bypass -File "%%f"'}")
|
||||
|
||||
ECHO -
|
||||
ECHO This Window will close in:
|
||||
#timeout /T 10
|
||||
endlocal
|
||||
exit
|
||||
@@ -0,0 +1,47 @@
|
||||
Version 1.3.0.0 - 20.04.2018 dev
|
||||
NEW: - Pre connection Check for the windream Server (ping). See config file -> TestConnection
|
||||
FIX: -
|
||||
CHG: - Using new PowerShell Module for reading config file (Read-ConfigFile2.psm1 instead of Read-ConfigFile.psm1)
|
||||
REM: -
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Version 1.2.0.0 - 04.01.2017
|
||||
NEW: - Multilanguage Support (en, de, nl) for Message Boxes (only in interactive mode).
|
||||
FIX: -
|
||||
CHG: - Exception in case, no windream Client was found.
|
||||
REM: -
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Version 1.1.0.2 - 02.12.2016
|
||||
NEW: - Help text for calling this Script with a Parameter
|
||||
- New Version of Module "Start-windreamSession-withLogging" will automatically map the windream Drive,
|
||||
if not connected but configured in wmcc Server Selector.
|
||||
FIX: -
|
||||
CHG: - Script will exit, if one or more external Functions couldnt be loaded.
|
||||
REM: -
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Version 1.1.0.0 - 30.11.2016
|
||||
NEW: - Initial check (MSGBox Yes/No) whether the windream Connectivity Test,
|
||||
should be started (only in interactive mode).
|
||||
FIX: -
|
||||
CHG: -
|
||||
REM: -
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Version 1.0.0.0 - 21.11.2016
|
||||
NEW: -
|
||||
FIX: -
|
||||
CHG: -
|
||||
REM: -
|
||||
|
||||
-------------------------------------legend------------------------------------
|
||||
NEW: = Added a new functionality
|
||||
FIX: = Fixed a Issue with existing functionality
|
||||
CHG: = Changed a existing functionality
|
||||
REM: = Removed a functionality
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -0,0 +1,45 @@
|
||||
@ECHO OFF
|
||||
TITLE DIGITAL DATA - Run all files in directory with current permissions
|
||||
ECHO -
|
||||
ECHO Batch Script
|
||||
ECHO Run all files in directory with current permissions
|
||||
ECHO -
|
||||
ECHO Digital Data
|
||||
ECHO Ludwig-Rinn-Strasse 16
|
||||
ECHO 35452 Heuchelheim
|
||||
ECHO Tel.: 0641 / 202360
|
||||
ECHO E-Mail: info@didalog.de
|
||||
ECHO -
|
||||
ECHO Version 1.0.0.0
|
||||
ECHO Date: 13.08.2015
|
||||
ECHO -
|
||||
ECHO Program Startup %date% at %time:~0,8% oclock, on %computername%.
|
||||
|
||||
REM --------------------------------------------------------------
|
||||
REM ------------------------set variables-------------------------
|
||||
REM --------------------------------------------------------------
|
||||
|
||||
setlocal enableextensions
|
||||
|
||||
SET DIRECTORY="%cd%"
|
||||
SET FILEEXTENSION=*.ps1
|
||||
SET COUNT=0
|
||||
|
||||
REM --------------------------------------------------------------
|
||||
REM ---------------------Program 1 / Script 1---------------------
|
||||
REM --------------------------------------------------------------
|
||||
|
||||
FOR /F "tokens=*" %%f in ('dir /S /b %FILEEXTENSION%') do (ECHO %%f && set /a count+=1)
|
||||
ECHO -
|
||||
ECHO Found %count% File(s) with File Extension %FILEEXTENSION% in Directory:
|
||||
ECHO %DIRECTORY%.
|
||||
|
||||
ECHO -
|
||||
ECHO Running this/them now, with your permissions!
|
||||
FOR /F "tokens=*" %%f in ('dir /S /b %FILEEXTENSION%') do (PowerShell.exe -Command "& {Start-Process PowerShell.exe -WindowStyle hidden '-ExecutionPolicy Bypass -File "%%f" -argOperationMode "interactive"'}")
|
||||
|
||||
ECHO -
|
||||
ECHO This Window will close in:
|
||||
#timeout /T 10
|
||||
endlocal
|
||||
exit
|
||||
@@ -0,0 +1,78 @@
|
||||
####################################################################################################
|
||||
# Digital Data Configuration File (Template Date: 30.07.2016) #
|
||||
# UTF-8 Coding required! #
|
||||
# incl. FailSafe functions that are active when information is missing. #
|
||||
####################################################################################################
|
||||
|
||||
#==================================================================================================#
|
||||
########################################## General Setup ###########################################
|
||||
#==================================================================================================#
|
||||
|
||||
####################################################################################################
|
||||
# Path in which the log files will be stored. #
|
||||
# Example: E:\LogFiles\<ScriptName> #
|
||||
# FailSafe Setting is: <ScriptPath> #
|
||||
####################################################################################################
|
||||
LogPath =
|
||||
|
||||
####################################################################################################
|
||||
# Numerical value how long (in days) log files will be kept. ValidateRange is 0 - 1000 #
|
||||
# Value of 0 disables the delete function completely. #
|
||||
# FailSafe Setting is: 60 #
|
||||
####################################################################################################
|
||||
LogFileKeepTime = 3
|
||||
|
||||
####################################################################################################
|
||||
# Name or IP-Adress of the windream Server. #
|
||||
# Server connection will be tested via ICMP before the windream Session will be tested, #
|
||||
# if a value is set. If no value is set, Test will be skipped. #
|
||||
# Example: dms-server.fqdn.local #
|
||||
####################################################################################################
|
||||
ConnectionTest =
|
||||
|
||||
####################################################################################################
|
||||
# Set the User Interface Language. Please check for existing .psd1 File in the Localized Subfolder.#
|
||||
# If you did not set this Option, Script will retrive the current Language itself. #
|
||||
# Example: de-de #
|
||||
# FailSafe Setting is: en-us #
|
||||
####################################################################################################
|
||||
UICultureForce =
|
||||
|
||||
####################################################################################################
|
||||
# Numerical value how many Reconnect Trys will be done if windream Connection is lost. #
|
||||
# Example: 10 #
|
||||
# FailSafe Setting is: 5 #
|
||||
####################################################################################################
|
||||
windreamClientRestartTrys = 10
|
||||
|
||||
#==================================================================================================#
|
||||
########################################## Impersonation ###########################################
|
||||
#==================================================================================================#
|
||||
|
||||
####################################################################################################
|
||||
# To use the windream Impersonation Login Methode, you have to set the windream Server Name. #
|
||||
# For Impersonation Login all four Settings must be set, otherwise Standard Login will be used. #
|
||||
# Example: windream-DB01 #
|
||||
####################################################################################################
|
||||
windreamServer =
|
||||
|
||||
####################################################################################################
|
||||
# To use the windream Impersonation Login Methode, you have to set the Windows Domain. #
|
||||
# For Impersonation Login all four Settings must be set, otherwise Standard Login will be used. #
|
||||
# Example: WindowsDomain.local #
|
||||
####################################################################################################
|
||||
windreamDomain =
|
||||
|
||||
####################################################################################################
|
||||
# To use the windream Impersonation Login Methode, you have to set the windream User Name. #
|
||||
# For Impersonation Login all four Settings must be set, otherwise Standard Login will be used. #
|
||||
# Example: UserName #
|
||||
####################################################################################################
|
||||
windreamUserName =
|
||||
|
||||
####################################################################################################
|
||||
# To use the windream Impersonation Login Methode, you have to set the windream User Password. #
|
||||
# For Impersonation Login all four Settings must be set, otherwise Standard Login will be used. #
|
||||
# Example: UserPassword #
|
||||
####################################################################################################
|
||||
windreamUserPassword =
|
||||
Binary file not shown.
Reference in New Issue
Block a user