007.Register Acer thin testing machine

master
Tudor Stanciu 2022-01-22 00:59:20 +02:00
parent f8cfb70bc8
commit 3228609fcb
1 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,29 @@
if not exists (select top 1 1 from Machine where MachineName = '***REMOVED***')
begin
insert into Machine(MachineName, FullMachineName, MACAddress, IPv4Address, [Description])
select '***REMOVED***', '***REMOVED***', '***REMOVED***', '***REMOVED***', '***REMOVED*** - Acer thin testing machine'
end
go
declare @machine_id int, @server_performer_id int, @agent_performer_id int
select @machine_id = MachineId from Machine where MachineName = '***REMOVED***'
select @server_performer_id = PerformerId from PowerActionPerformer where PerformerCode = 'NETWORK_RESURRECTOR_SERVER'
select @agent_performer_id = PerformerId from PowerActionPerformer where PerformerCode = 'NETWORK_RESURRECTOR_AGENT'
if not exists (select top 1 1 from MachineAgent where MachineId = @machine_id)
begin
insert into MachineAgent (MachineId, AgentPort)
select @machine_id, ***REMOVED***
end
if not exists (select top 1 1 from PowerActionConfiguration where MachineId = @machine_id)
begin
insert into PowerActionConfiguration (MachineId, PowerActionId, PerformerId)
select @machine_id,
PowerActionId,
case when PowerActionCode in ('WAKE', 'PING') then @server_performer_id
else @agent_performer_id
end
from PowerAction
end
go