Tag Archives: Powershell

German date is not accepted in Powershell

Problem: Systems or commands  working with english datetime do not accept german date formats. Converting them directly to Datetime ist not possible.  “System.DateTime”. Error: “String was not recognized as a valid DateTime.” Example: Solution: Convert the date to an english datetime … Continue reading

Posted in Information Technology | Tagged | Comments Off on German date is not accepted in Powershell

Powershell from scheduled task

As powershell is running by default in secure mode , use the following setting to run powershell scripts from a scheduled task. This way you do not have to elevate the rights for running scripts. Ensure your Powershell script is … Continue reading

Posted in Information Technology, Tips | Tagged | Comments Off on Powershell from scheduled task

ADDS Dump thumbnailPhoto to JPG file

Use this command line in Powershell to save a users thumbnailPhoto to a file. First start a Powershell session with Active Directory Modules loaded, then: get-aduser “sAMAccountname” -server “FQDN Domain Controller”-properties thumbnailPhoto | select -expandproperty thumbnailphoto | set-content -path “JPG … Continue reading

Posted in Information Technology, Tips | Tagged , | Comments Off on ADDS Dump thumbnailPhoto to JPG file

Clear Protected from accidental deletion flag

Windows Active Directory protects per default Organizational Units (OU) from accidential deletion . To clear this flag for an entire OU structure you can use this Powershell commands . This example command will remove the flag from an OU structure … Continue reading

Posted in Information Technology, Tips | Tagged , | Comments Off on Clear Protected from accidental deletion flag

Powershell write to file creates strange characters

Problem Reason The file was created by using the command  add-content without definition of encoding (default ANSI encoding). Later on lines where added by using command out-file (default Unicode encoding) Solution Do not mix the two line writer add-content and out-file … Continue reading

Posted in Fix IT | Tagged , | Comments Off on Powershell write to file creates strange characters

Read and change Active Synch profile domain wide

To list or change Active Sync profiles from users in a forest use the following Powershell PS1 commands. Run these lines in a Exchange 2010 PS1 box # select the Forest as target set-adServerSettings -viewEntireForest $true # list user with … Continue reading

Posted in Uncategorized | Tagged , | Comments Off on Read and change Active Synch profile domain wide