Skip to content

Commit

Permalink
script library Set Ethernet to use DHCP
Browse files Browse the repository at this point in the history
  • Loading branch information
silversword411 committed Apr 19, 2021
1 parent 36a902a commit e58881c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
10 changes: 10 additions & 0 deletions api/tacticalrmm/scripts/community_scripts.json
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,16 @@
"category": "TRMM (Win):Network",
"default_timeout": "90"
},
{
"guid": "745bb7cd-b71a-4f2e-b6f2-c579b1828162",
"filename": "Win_Network_DHCP_Set.bat",
"submittedBy": "https://github.com/silversword411",
"name": "Network - Set Primary NIC to DHCP",
"description": "Enable DHCP on primary adapter",
"shell": "cmd",
"category": "TRMM (Win):Network",
"default_timeout": "90"
},
{
"guid": "6ce5682a-49db-4c0b-9417-609cf905ac43",
"filename": "Win_Win10_Change_Key_and_Activate.ps1",
Expand Down
13 changes: 13 additions & 0 deletions scripts/Win_Network_DHCP_Set.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@echo off
for /f "tokens=4-5 delims=. " %%i in ('ver') do set VERSION=%%i.%%j

if "%version%" == "6.1" (
rem Windows 7
netsh interface ip set address "Local Area Connection" dhcp
netsh interface ip set dns "Local Area Connection" dhcp
)
if "%version%" == "10.0" (
rem Windows 10
netsh interface ip set address Ethernet dhcp
netsh interface ip set dns Ethernet dhcp
)

0 comments on commit e58881c

Please sign in to comment.