Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #PS Wlan Script Connection
- #Created by Emmanuel.D.Breyaue
- #Credits by
- #nerdemma.mastodon.social
- #links.rebel.ar/nerdemma
- #set folder to the xml profile conection file.
- $CURRENT_DIR=(pwd).path
- $PATH = $CURRENT_DIR+"\Profiles\"
- $NAME = Read-Host -Prompt "NAME OF ACCESS POINT (SSID)"
- $FILE=$NAME
- $AUTHENTICATION = 'WPA2PSK'
- $ENCRYPTION = 'AES'
- $PASSWORD = Read-Host -Prompt "PASSWORD"
- #save the xml profile connection file
- $NEWPROFILE = @'
- <?xml version="1.0"?>
- <WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">
- <name>{0}</name>
- <SSIDConfig>
- <SSID>
- <name>{0}</name>
- </SSID>
- </SSIDConfig>
- <connectionType>ESS</connectionType>
- <connectionMode>auto</connectionMode>
- <MSM>
- <security>
- <authEncryption>
- <authentication>{1}</authentication>
- <encryption>{2}</encryption>
- <useOneX>false</useOneX>
- </authEncryption>
- <sharedKey>
- <keyType>passPhrase</keyType>
- <protected>false</protected>
- <keyMaterial>{3}</keyMaterial>
- </sharedKey>
- </security>
- </MSM>
- <MacRandomization xmlns="http://www.microsoft.com/networking/WLAN/profile/v3">
- <enableRandomization>false</enableRandomization>
- </MacRandomization>
- </WLANProfile>
- '@ -f $NAME, $AUTHENTICATION, $ENCRYPTION, $PASSWORD
- $FILE=$FILE+'.xml'
- $NEWPROFILE | Out-File $PATH$FILE
- #conect $name y/n
- #connecting to the network
- netsh wlan add profile filename=$PATH$FILE
- netsh wlan connect name=$NAME ssid=$NAME
- netsh wlan show interfaces
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement