Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $group_policy_profiles = (netsh wlan show profile)
- $user_profiles = @()
- foreach ($policy_profile in $group_policy_profiles) {
- if ($policy_profile -match "All User Profile") {
- $profile_name = $policy_profile.split(":")[1]
- $user_profiles += $profile_name.Remove(0, 1)
- }
- }
- $network_data = @()
- foreach ($user_profile in $user_profiles) {
- $profile_info = (netsh wlan show profile $user_profile key=clear)
- $profile_info_dict = @{}
- foreach ($info in $profile_info) {
- if ($info -match "Key Content") {
- $key_content = $info.split(":")[1].Remove(0, 1)
- $profile_info_dict.Add("network", $user_profile)
- $profile_info_dict.Add("key", $key_content)
- }
- }
- $network_data += $profile_info_dict
- }
- echo $network_data
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement