POWERSHELL

Using Powershell to access Twitter REST API

Andres Bohren
Hallo zusammen, Nachdem ich mir nun die Grundlagen von REST beigebracht habe, wollte ich nun das REST API von Twitter ausprobieren. Als erstes muss man in seinem Twitter Account die Mobilnummer registrieren Und danach den Verifikationscode welcher per SMS versendet wird eingeben Nun muss eine neue Applikation erstellt werden https://apps.twitter.com/app/new Läuft alles glatt, so wird eine neue Applikation angelegt. Die Details, welche ich benötige sind unter "manage keys and access tokens"

Powershell Remoting with Azure AD

Andres Bohren
Hallo zusammen, Ich habe mir mal angeschaut, wie man mit der Powershell auf Azure AD zugreifen kann. Dazu muss man den "Microsoft Online Service Sign-In Assistant" und das "Azure Active Directory Module for Windows PowerShell" installieren. Manage Azure AD using Windows PowerShell https://msdn.microsoft.com/en-us/library/azure/jj151815.aspx Microsoft Online Services Sign-In Assistant for IT Professionals RTW http://www.microsoft.com/en-us/download/confirmation.aspx?id=41950 Azure Active Directory Module for Windows PowerShell (64-bit version), http://go.microsoft.com/fwlink/p/?linkid=236297 Entweder man startet dann den Shortcut auf dem Desktop oder Importiert das MsOnline Powershell Modul

DNS Lookups with Powershell

Andres Bohren
Hallo zusammen, Mit Powershell 4.0 gibt es endlich ein cmdlet welches alle DNS Querys erlaubt. Resolve-DnsName https://technet.microsoft.com/en-us/library/jj590781.aspx Resolve-DnsName -Name icewolf.ch -Type NS Resolve-DnsName -Name icewolf.ch -Type SOA Resolve-DnsName -Name icewolf.ch -Type MX Resolve-DnsName -Name icewolf.ch -Type TXT Resolve-DnsName -Name www.icewolf.ch -Type A Resolve-DnsName -Name _ldap._tcp.corp.icewolf.ch -Type SRV Resolve-DnsName -Name 172.21.175.20 -Type PTR Grüsse Andres Bohren

Powershell Remoting with Exchange Online

Andres Bohren
Hallo zusammen, Ich habe mir mal angeschaut, wie man mit der Powershell auf Exchange Online zugreifen kann $cred = Get-Credential $ExSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/PowerShell/ -Credential $cred -Authentication Basic -AllowRedirection Import-PSSession -Session $ExSession Remove-PSSession $ExSession Grüsse Andres Bohren

Powershell Remoting with Lync Online

Andres Bohren
Hallo zusammen, Ich habe mir mal angeschaut, wie man mit der Powershell auf Lync Online zugreifen kann. Dazu muss man das Windows PowerShell Module für Lync Online installieren. Windows PowerShell Module for Lync Online http://www.microsoft.com/en-us/download/details.aspx?id=39366 Danach kann man eine Remote PowerShell Session auf Lync Online herstellen $cred = Get-Credential $lyncSession = New-CsOnlineSession -Credential $cred Import-PSSession $LyncSession Remove-PSSession $LyncSession Eine Dokumentation der Lync Online Commandlets gibt es hier Lync Online cmdlets

Dotnet Framework Regular Expressions (RegEx) Quick Reference

Andres Bohren
Hallo zusammen, Beim sufen bin ich über folgendes gestolpert - kann man sicherlich beim nächsten Powershell Script brauchen .NET Framework Regular Expressions - Quick Reference http://www.microsoft.com/en-us/download/details.aspx?id=43119 Grüsse Andres Bohren

Powershell Update-Help

Andres Bohren
Hallo zusammen, Ich habe kürzlich mal wieder mit der Powershell rumgespielt. In der Zwischenzeit habe ich auf Powershell 4.0 aktualisiert. Nun muss also erstmal die Hilfe aktualisiert werden. Update-Help http://technet.microsoft.com/en-us/library/hh849720.aspx Danach erhalte ich erstmal eine heftige rote Fehlermeldung Also die Powershell als Administrator starten und den Befehl nochmals ausführen Update-Help Die aktualisierten Hilfedateien landen hier C:\Windows\System32\WindowsPowerShell\v1.0\en-US Nun ist die Hilfe aktualisiert. Grüsse Andres Bohren

Zip a File with Powershell 3.0

Andres Bohren
Hallo zusammen, Mit dem folgenden Code kann man ohne zusätzliche Komponenten Files in ein ZIP Archiv packen. Add-Type -As System.IO.Compression.FileSystem [System.IO.Compression.CompressionLevel]$Compression = "Optimal" #ZIP a File [String]$ZipFilePath = "c:\temp\test.zip" [String]$File = "c:\temp\Mailboxes.txt" $Archive = [System.IO.Compression.ZipFile]::Open( $ZipFilePath, "Update" ) $null = [System.IO.Compression.ZipFileExtensions]::CreateEntryFromFile($Archive, $file, "Mailboxes.txt", $Compression) $archive.Dispose() Grüsse Andres Bohren

Remove AelitaEMW Messages in Public Folder with EWS Managed API

Andres Bohren
Hallo zusammen, Ich habe ein Powershell Script entwickelt um die Quest Migration Manager Messages nach der Migration im Public Folder zu entfernen. Das Script nutzt die EWS Managed API http://www.microsoft.com/en-us/download/details.aspx?id=35371 ############################################################################### # Remove Quest Migration Manager Hidden Messages in Public Folders # Remove Messages with Subject "AelitaEMW_" in Associated Content Store # # Script Uses EWS Managed API # http://www.microsoft.com/en-us/download/details.aspx?id=35371 # # Version 1.0 / 27.10.2013 # Andres Bohren / www.

Download File from Internet with powershell and proxyauthentication

Andres Bohren
Hallo zusammen, Heute musste ich ein Powershell Script erstellen, welches ein File aus dem Internet herunterlädt. Und dies auch noch über einen Authenticated Proxy. Am besten so, dass weder Benutzername noch Passwort im Script hinterlegt werden muss. #/*NoProxy*/ $source = "http://www.funkykitchenclub.ch/robots.txt" $dest = "c:\temp\file.txt" $WebClient = New-Object System.Net.WebClient $WebClient.DownloadFile($source,$dest) #/*Proxy with Authentication*/ $source = "http://www.funkykitchenclub.ch/robots.txt" $dest = "c:\temp\file.txt" $WebClient = New-Object System.Net.WebClient $WebProxy = New-Object System.Net.WebProxy("http://ICESRV03.corp.icewolf.ch:8080",$true) $WebProxy.UseDefaultCredentials = $true $WebClient.Proxy = $WebProxy