From 4f7e9dff89d7708cf6ff82f4be6c84652d23a948 Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Tue, 15 Oct 2024 15:56:45 -0600 Subject: [PATCH] fix radius wifi network commands.json --- .../Windows Commands/Windows - Forget RADIUS WiFi Network.md | 2 +- PowerShell/JumpCloud Commands Gallery/commands.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PowerShell/JumpCloud Commands Gallery/Windows Commands/Windows - Forget RADIUS WiFi Network.md b/PowerShell/JumpCloud Commands Gallery/Windows Commands/Windows - Forget RADIUS WiFi Network.md index a921c63c5..d5c3a2ebd 100644 --- a/PowerShell/JumpCloud Commands Gallery/Windows Commands/Windows - Forget RADIUS WiFi Network.md +++ b/PowerShell/JumpCloud Commands Gallery/Windows Commands/Windows - Forget RADIUS WiFi Network.md @@ -18,7 +18,7 @@ $RadiusSSID = '' $Overwrite = $false -#### DO NOT EDIT BELOW THIS LINE #### +# DO NOT EDIT BELOW THIS LINE # $removeWifips1 = @" function Get-WifiProfile { [cmdletbinding()] diff --git a/PowerShell/JumpCloud Commands Gallery/commands.json b/PowerShell/JumpCloud Commands Gallery/commands.json index 5513541ee..22c455f21 100644 --- a/PowerShell/JumpCloud Commands Gallery/commands.json +++ b/PowerShell/JumpCloud Commands Gallery/commands.json @@ -289,7 +289,7 @@ { "name": "Windows - Forget RADIUS WiFi Network | v1.0 JCCG", "type": "windows", - "command": "# Enter the SSID of the Radius network\n$RadiusSSID = ''\n\n# Change Overwrite to $true if you would like to re-create existing Scheduled Tasks\n# This should only be used if redistributing this command to devices\n$Overwrite = $false", + "command": "# Enter the SSID of the Radius network\n$RadiusSSID = ''\n\n# Change Overwrite to $true if you would like to re-create existing Scheduled Tasks\n# This should only be used if redistributing this command to devices\n$Overwrite = $false\n\n\n# DO NOT EDIT BELOW THIS LINE #\n$removeWifips1 = @\"\nfunction Get-WifiProfile {\n [cmdletbinding()]\n param\n (\n [System.Array]`$Name = `$NULL\n )\n Begin {\n `$list = ((netsh.exe wlan show profiles) -match '\\s{2,}:\\s') -replace '.*:\\s' , ''\n `$ProfileList = `$List | Foreach-object { [pscustomobject]@{Name = `$_ } }\n }\n Process {\n Foreach (`$WLANProfile in `$Name) {\n `$ProfileList | Where-Object { `$_.Name -match `$WLANProfile }\n }\n\n }\n End {\n If (`$Name -eq `$NULL) {\n `$Profilelist\n }\n }\n}\nfunction Remove-WifiProfile {\n [cmdletbinding()]\n param\n (\n [System.Array]`$Name = `$NULL\n )\n begin {}\n process {\n Foreach (`$item in `$Name) {\n `$Result = (netsh.exe wlan delete profile `$item)\n If (`$Result -match 'deleted') {\n \"WifiProfile : `$Item Deleted\"\n } else {\n \"WifiProfile : `$Item NotFound\"\n }\n }\n }\n}\n\nRemove-WifiProfile \"$($RadiusSSID)\"\n\"@\nfunction Distribute-JCScheduledTask {\n param (\n [boolean]$Overwrite\n )\n # Get Current User for JC Commmand\n $CurrentUser = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name\n\n # Scheduled Task XML Configuration\n $ScheduledTaskXML = @\"\n\n\n \n false\n true\n IgnoreNew\n \n true\n false\n \n \n \n \n <QueryList><Query Id=\"0\" Path=\"Microsoft-Windows-WLAN-AutoConfig/Operational\"><Select Path=\"Microsoft-Windows-WLAN-AutoConfig/Operational\">*[System[Provider[@Name='Microsoft-Windows-WLAN-AutoConfig'] and Task = 24010 and (EventID=8002)]]</Select></Query></QueryList>\n \n \n \n \n \"C:\\Windows\\SysWOW64\\WindowsPowerShell\\v1.0\\powershell.exe\"\n -ExecutionPolicy ByPass -File \"C:\\scripts\\removeWifi.ps1\"\n \n \n\n\"@\n # Check if the scheduled task exists, skip unless Overwrite is specified\n $scheduledTask = Get-ScheduledTask -TaskName \"JumpCloud - Remove WiFi Failure\" -ErrorAction SilentlyContinue\n if ($scheduledTask) {\n Write-Output \"[status] JumpCloud - Remove WiFi Failure scheduled task already exists\"\n if ($Overwrite) {\n # Save the removeWifi.ps1 file to C:\\scripts\\removeWifi.ps1\n if (!(Test-Path -Path C:\\scripts)) {\n New-Item -Path \"C:\\\" -Name \"scripts\" -ItemType \"directory\"\n }\n $removeWifips1 | Out-File -FilePath C:\\scripts\\removeWifi.ps1 -force\n # Overwrite specified, unregister existing task and recreate\n Unregister-ScheduledTask -TaskPath '\\JumpCloud RADIUS\\' -TaskName 'JumpCloud - Remove Wifi Failure' -Confirm:$false\n Write-Output \"[status] Removed existing 'JumpCloud - Remove WiFi Failure' Scheduled Task\"\n Register-ScheduledTask -xml $ScheduledTaskXML -TaskName \"JumpCloud - Remove WiFi Failure\" -TaskPath \"\\JumpCloud RADIUS\\\" -User $CurrentUser \u2013Force\n Write-Output \"[status] Distributed 'JumpCloud - Remove WiFi Failure' Scheduled Task\"\n }\n } else {\n # Save the removeWifi.ps1 file to C:\\scripts\\removeWifi.ps1\n if (!(Test-Path -Path C:\\scripts)) {\n New-Item -Path \"C:\\\" -Name \"scripts\" -ItemType \"directory\"\n }\n $removeWifips1 | Out-File -FilePath C:\\scripts\\removeWifi.ps1\n # Create the Scheduled Task\n Register-ScheduledTask -xml $ScheduledTaskXML -TaskName \"JumpCloud - Remove WiFi Failure\" -TaskPath \"\\JumpCloud RADIUS\\\" -User $CurrentUser \u2013Force\n Write-Output \"[status] Distributed 'JumpCloud - Remove WiFi Failure' Scheduled Task\"\n }\n}\nDistribute-JCScheduledTask -Overwrite $Overwrite", "link": "https://github.com/TheJumpCloud/support/blob/master/PowerShell/JumpCloud%20Commands%20Gallery/Windows%20Commands/Windows%20-%20Forget%20RADIUS%20WiFi%20Network.md", "description": "The purpose of this script is to resolve an issue when a user changes their JumpCloud password after connecting to a JumpCloud backed Radius network they will never be able to connect unless they forget the existing network.\n\nIn order to accomplish this, the command will create a scheduled task on the workstation that looks for 8002 errors when attempting to connect to the specified Radius SSID. If an error is detected, a PowerShell script will be initiated that will forget the network for the user which will allow them to attempt to connect again and prompt for their updated credentials" },