Code Snippets

ConnectExchangeOnline

ConnectExchangeOnline

### Erstellt ein PSCredential Object und befüllt es mit den Anmeldedaten zum Exchange Online ECP $UserCredential = Get-Credential ### Erstellt ein Session-Object mit den zuvor eingegeben Anmeldedaten $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection ### Importiert die zuvor erstelle Session Import-PSSession $Session -DisableNameChecking

Region_de-AT.intl.cpl

Region_de-AT.intl.cpl

$regionalsettings = "<gs:GlobalizationServices xmlns:gs=’urn:longhornGlobalizationUnattend‘> <!–User List–> <gs:UserList> <gs:User UserID=’Current‘ CopySettingsToDefaultUserAcct=’true‘ CopySettingsToSystemAcct=’true’/> </gs:UserList> <!– user locale –> <gs:UserLocale> <gs:Locale Name=’de-AT‘ SetAsCurrent=’true‘ ResetAllSettings=’true’/> </gs:UserLocale> <!– system locale –> <gs:SystemLocale Name=’de-AT’/> <!– GeoID –> <gs:LocationPreferences> <gs:GeoID Value=’14’/> </gs:LocationPreferences> <gs:MUILanguagePreferences> <gs:MUILanguage Value=’de-AT’/> </gs:MUILanguagePreferences> <!– input preferences –> <gs:InputPreferences> <!–en-AU–> <gs:InputLanguageID Action=’add‘ ID=’0c07:00000407′ Default=’true’/> </gs:InputPreferences> </gs:GlobalizationServices>" $regionalsettings | Out-File C:\Windows\Temp\Region_de-AT.xml...

StartLayout_RDS.xml

StartLayout_RDS.xml

<LayoutModificationTemplate Version="1" xmlns="http://schemas.microsoft.com/Start/2014/LayoutModification"> <LayoutOptions StartTileGroupCellWidth="6" /> <DefaultLayoutOverride LayoutCustomizationRestrictionType="OnlySpecifiedGroups"> <StartLayoutCollection> <defaultlayout:StartLayout GroupCellWidth="6" xmlns:defaultlayout="http://schemas.microsoft.com/Start/2014/FullDefaultLayout"> <start:Group Name="Programme" xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout"> <start:DesktopApplicationTile Size="2×2" Column="2" Row="0" DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Word.lnk" /> <start:DesktopApplicationTile Size="2×2" Column="2" Row="2" DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\PowerPoint.lnk" /> <start:DesktopApplicationTile Size="2×2" Column="0" Row="2" DesktopApplicationLinkPath="%APPDATA%\Microsoft\Windows\Start Menu\Programs\Microsoft Teams.lnk" /> <start:DesktopApplicationTile Size="2×2" Column="0" Row="0" DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Outlook.lnk" /> <start:DesktopApplicationTile Size="2×2" Column="4" Row="0" DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Excel.lnk" /> <start:DesktopApplicationTile Size="2×2" Column="4" Row="2"...

RemoveMicrosoftTeams.ps1

RemoveMicrosoftTeams.ps1

<# .SYNOPSIS This script allows you to uninstall the Microsoft Teams app and remove Teams directory for a user. .DESCRIPTION Use this script to clear the installed Microsoft Teams application. Run this PowerShell script for each user profile for which the Teams App was installed on a machine. After the PowerShell has executed on all...

VMWare_Shrink-Disk

VMWare_Shrink-Disk

# Disk DescriptorFile version=3 encoding="UTF-8" CID=8e8083a2 parentCID=ffffffff isNativeSnapshot="no" createType="vmfs" # Extent description RW 398458880 VMFS "testvm-flat.vmdk" # Change Tracking File changeTrackPath="testvm-ctk.vmdk" # The Disk Data Base #DDB ddb.adapterType = "lsilogic" ddb.deletable = "true" ddb.geometry.cylinders = "24802" ddb.geometry.heads = "255" ddb.geometry.sectors = "63" ddb.longContentID = "c8e4f11aaccfe8f5b9b2854a8e8083a2" ddb.thinProvisioned = "1" ddb.toolsInstallType = "1" ddb.toolsVersion = "10249" ddb.uuid...

RDS01_ExcludeFolders

RDS01_ExcludeFolders

PS C:\Windows\system32> Get-RDSessionCollectionConfiguration "TEST" -UserProfileDisk | fl CollectionName : TEST IncludeFolderPath : ExcludeFolderPath : {Desktop, Documents, Contacts} IncludeFilePath : ExcludeFilePath : DiskPath : \\test.local\RDSUserProfileDisks EnableUserProfileDisk : True MaxUserProfileDiskSizeGB : 20

RDS01_qwinsta

RDS01_qwinsta

C:\Users\administrator>qwinsta /server:server_name SESSIONNAME USERNAME ID STATE TYPE DEVICE services 0 Disc console 1 Conn rdp-tcp#98 user01 23 Active rdp-tcp#91 user02 39 Active rdp-tcp#75 user03 40 Active rdp-tcp#19 user04 41 Active rdp-tcp#26 user05 42 Active rdp-tcp#84 user06 43 Active rdp-tcp#93 user07 44 Active

DualScan01

DualScan01

PS C:\Users\anxadmin> $MUSM = New-Object -ComObject "Microsoft.Update.ServiceManager" PS C:\Users\anxadmin> $MUSM.Services | select Name, IsDefaultAUService Name IsDefaultAUService —- —————— Windows Server Update Service False Windows Update True

openHAB jdbc.persist

openHAB jdbc.persist

Strategies { everyMinute : "0 * * * * ?" every15Minutes : "0 */15 * ? * *" everyHour : "0 0 * * * ?" everyDay : "0 0 0 * * ?" default = everyChange } Items { Socket01_power : strategy = every15Minutes, restoreOnStartup }

OpenHAB jdbc.cfg

OpenHAB jdbc.cfg

############################ JDBC Persistence Service ################################## # D A T A B A S E C O N F I G url=jdbc:mariadb://192.168.1.10:3307/openhab # url=jdbc:mysql://192.168.0.1:3306/testMysql # url=jdbc:postgresql://192.168.0.1:5432/testPostgresql # required database user user=openhab # required database password password=SUPERSAFEPA$$WORD #######################################################################################