
★★★ Live配信告知 ★★★ぜひお申込みください! |
こんにちは。サイオステクノロジー技術部 武井です。MacでPowerShellしてみました。
MacでPowerShell?
Macをお使いの方は、Virtual BoxやParallels等で構築したWindowsに切り替えてから、PowerShell使うと思いますが、やっぱり少々めんどくさいです。MacでPowerShellを使えればいいなぁと思っていました。
インストール方法
マイクロソフトは、PowerShellをオープンソース化して、いろんなOS上で使えるようにしてくれました。Macも例外ではありません。以下、インストール方法です。
Macの便利なパッケージ管理システムHomeBrewをインストールします。(既にインストール済みの方は、省略して下さい)
1 |
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" |
Powershellをインストールします。
1 2 |
$ brew tap caskroom/cask $ brew cask install powershell |
これでインストールは完了です。早速ExchangeにPowershellを打ってみます。
1 2 3 4 5 6 7 8 9 10 11 12 |
$ pwsh <strong>PS /Users/ntakei></strong> $O365Credential = Get-Credential PowerShell credential request Enter your credentials. User: ntakei@contoso.onmicrosoft.com Password for user ntakei@contoso.onmicrosoft.com: ******** <strong>PS /Users/ntakei></strong> $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $O365Credential -Authentication Basic -AllowRedirection <strong>PS /Users/ntakei></strong> Import-PSSession -Session $Session <strong>PS /Users/ntakei></strong> Get-Mailbox -Identity ntakei@contoso.onmicrosoft.com Name Alias ServerName ProhibitSendQuota ---- ----- ---------- --------------- ntakei ntakei XXXXXXXXXXXX 99 GB (106,3... |
おお、ちゃんとできました。
ちなみにOffice365へのPowerShell(Get-MsolUserとか)はまだ、使えないようです。Install-Module -Name AzureADがエラーになりました(´;ω;`)
ご覧いただきありがとうございます。
ブログの最新情報はSNSでも発信しております。
ぜひTwitterのフォロー&Facebookページにいいねをお願い致します!

>> 雑誌等の執筆依頼を受付しております。
ご希望の方はお気軽にお問い合わせください!
Be the first to comment