Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Power Bi gateway just works for a few hours.

I'm having issues with a Power BI gateway, I installed it as a service and with admin permissions, but it just works a few hours. On it's documentation there is a sentence: "The gateway cannot be installed on a domain controller". How can I check if my Windows is a domain controller?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I fixed it creating a cmd script to restart the Power BI gateway and creating a task schedule to execute that script sometimes in a day.

 

Cmd's file code:

net stop DIAHostService
net start DIAHostService

And this is the content of the task scheduler:

<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
  <RegistrationInfo>
    <Date>2017-04-12T09:17:09.7077677</Date>
    <Author>YOUR_USER_NAME</Author>
    <Description>This task restarts the PowerBI Gateway (DIAHostService) sometimes in a day.</Description>
  </RegistrationInfo>
  <Triggers>
    <CalendarTrigger>
      <Repetition>
        <Interval>PT1H</Interval>
        <StopAtDurationEnd>false</StopAtDurationEnd>
      </Repetition>
      <StartBoundary>2017-04-12T09:20:26</StartBoundary>
      <ExecutionTimeLimit>PT30M</ExecutionTimeLimit>
      <Enabled>true</Enabled>
      <ScheduleByDay>
        <DaysInterval>1</DaysInterval>
      </ScheduleByDay>
    </CalendarTrigger>
  </Triggers>
  <Principals>
    <Principal id="Author">
      <UserId>YOUR_USER_NAME</UserId>
      <LogonType>Password</LogonType>
      <RunLevel>HighestAvailable</RunLevel>
    </Principal>
  </Principals>
  <Settings>
    <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
    <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
    <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
    <AllowHardTerminate>true</AllowHardTerminate>
    <StartWhenAvailable>false</StartWhenAvailable>
    <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
    <IdleSettings>
      <StopOnIdleEnd>true</StopOnIdleEnd>
      <RestartOnIdle>false</RestartOnIdle>
    </IdleSettings>
    <AllowStartOnDemand>true</AllowStartOnDemand>
    <Enabled>true</Enabled>
    <Hidden>false</Hidden>
    <RunOnlyIfIdle>false</RunOnlyIfIdle>
    <WakeToRun>true</WakeToRun>
    <ExecutionTimeLimit>PT5M</ExecutionTimeLimit>
    <Priority>7</Priority>
  </Settings>
  <Actions Context="Author">
    <Exec>
      <Command>PATH_TO_CMD_FILE\restart_powerbi_service.cmd</Command>
    </Exec>
  </Actions>
</Task>

Save this file as xml and import it on Windows Task Scheduler. Don't foget to change YOUR_USER_NAME by the user name of the machine that the Power BI gateway is running And change PATH_TO_CMD_FILE to the location of your cmd file. 

 

Hope it helps.

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

I fixed it creating a cmd script to restart the Power BI gateway and creating a task schedule to execute that script sometimes in a day.

 

Cmd's file code:

net stop DIAHostService
net start DIAHostService

And this is the content of the task scheduler:

<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
  <RegistrationInfo>
    <Date>2017-04-12T09:17:09.7077677</Date>
    <Author>YOUR_USER_NAME</Author>
    <Description>This task restarts the PowerBI Gateway (DIAHostService) sometimes in a day.</Description>
  </RegistrationInfo>
  <Triggers>
    <CalendarTrigger>
      <Repetition>
        <Interval>PT1H</Interval>
        <StopAtDurationEnd>false</StopAtDurationEnd>
      </Repetition>
      <StartBoundary>2017-04-12T09:20:26</StartBoundary>
      <ExecutionTimeLimit>PT30M</ExecutionTimeLimit>
      <Enabled>true</Enabled>
      <ScheduleByDay>
        <DaysInterval>1</DaysInterval>
      </ScheduleByDay>
    </CalendarTrigger>
  </Triggers>
  <Principals>
    <Principal id="Author">
      <UserId>YOUR_USER_NAME</UserId>
      <LogonType>Password</LogonType>
      <RunLevel>HighestAvailable</RunLevel>
    </Principal>
  </Principals>
  <Settings>
    <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
    <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
    <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
    <AllowHardTerminate>true</AllowHardTerminate>
    <StartWhenAvailable>false</StartWhenAvailable>
    <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
    <IdleSettings>
      <StopOnIdleEnd>true</StopOnIdleEnd>
      <RestartOnIdle>false</RestartOnIdle>
    </IdleSettings>
    <AllowStartOnDemand>true</AllowStartOnDemand>
    <Enabled>true</Enabled>
    <Hidden>false</Hidden>
    <RunOnlyIfIdle>false</RunOnlyIfIdle>
    <WakeToRun>true</WakeToRun>
    <ExecutionTimeLimit>PT5M</ExecutionTimeLimit>
    <Priority>7</Priority>
  </Settings>
  <Actions Context="Author">
    <Exec>
      <Command>PATH_TO_CMD_FILE\restart_powerbi_service.cmd</Command>
    </Exec>
  </Actions>
</Task>

Save this file as xml and import it on Windows Task Scheduler. Don't foget to change YOUR_USER_NAME by the user name of the machine that the Power BI gateway is running And change PATH_TO_CMD_FILE to the location of your cmd file. 

 

Hope it helps.

Greg_Deckler
Super User
Super User

nltest /dclist:{domainname}

 

Lists all DC's in a domain



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler, Do I have to change the {domainname}? If I understand your solution correctly, I run that command and got this output:

 

nltest /dclist:{domainname}
Cannnot find DC to get DC list from Status.= 1355 0x54b ERROR_NO_SUCH_DOMAIN.

 

Yes, replace {domainname} with the name of your domain.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler, I changed it to my current domain name and I got a list of 14 DCs. So, is my machine a domain controller? If yes, what is the solution for that? 

Check the name of your machine against the list of DC's returned. If your machine is in the list, it is a DC. Use "hostname" from the command prompt to get your computer name. Also, use "set" from the command prompt to verify that you entered the correct domain. Look for the USERDOMAIN property.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler, thank you! My machine isn't a DC. Can you tell me what is the next step to find what is my problem? The Power BI's site is telling me that my gateway is offiline, but my machine has a internet conexion and the Data Management service is still running.   

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Kudoed Authors