Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. $group_policy_profiles = (netsh wlan show profile)
  2. $user_profiles = @()
  3. foreach ($policy_profile in $group_policy_profiles) {
  4. if ($policy_profile -match "All User Profile") {
  5. $profile_name = $policy_profile.split(":")[1]
  6. $user_profiles += $profile_name.Remove(0, 1)
  7. }
  8. }
  9.  
  10. $network_data = @()
  11. foreach ($user_profile in $user_profiles) {
  12. $profile_info = (netsh wlan show profile $user_profile key=clear)
  13. $profile_info_dict = @{}
  14. foreach ($info in $profile_info) {
  15. if ($info -match "Key Content") {
  16. $key_content = $info.split(":")[1].Remove(0, 1)
  17. $profile_info_dict.Add("network", $user_profile)
  18. $profile_info_dict.Add("key", $key_content)
  19. }
  20. }
  21. $network_data += $profile_info_dict
  22. }
  23.  
  24. echo $network_data
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement