0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【メモ】証明書の選択、接続ユーザーの入力、接続を自動化するPowerShell

Last updated at Posted at 2023-03-02

$certThumbprint = "[証明書のThumbprint]"
$wifiProfile = "[接続プロファイル名]"
$username = "[ユーザー名]"
$password = "[パスワード]"

# 証明書を選択する
$cert = Get-ChildItem -Path Cert:\LocalMachine\My | Where-Object {$_.Thumbprint -eq $certThumbprint}
netsh wlan set profileparameter name="$wifiProfile" authentication="WPA2Enterprise" -userCertificate="$($cert.Thumbprint)" -storeCredential=yes

# 接続ユーザーを入力する
netsh wlan add profileparameter name="$wifiProfile" userAuth="yes" authMode="userOrMachine" -username="$username" -password="$password"

# 無線LANネットワークに接続する
netsh wlan connect name="$wifiProfile"

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?