Skip to main content

All Questions

Tagged with
1 vote
1 answer
542 views

How do I detect the presence of a new service on a windows server via PowerShell script

We have a need to detect installation of new services on our application servers. These are Windows 2016 & 2019 servers. I decided to write and schedule a PS script that will run twice a day. This ...
FemiA's user avatar
  • 13
0 votes
1 answer
79 views

Exercising clean code

I have a script that if kept on the same line, it'll be quite annoying to edit. But at the point at where I want to break line, I get the error when running, -ApplicationParameter : The term '-...
Zero596's user avatar
  • 83
1 vote
0 answers
81 views

Get-Service returns service from source machine, not remote machine

I have: My local machine Remote machine one (foo1.bin.com) Remote machine two (foo2.bin.com) I have the following piece of code: Get-Service -ComputerName foo2.bin.com When I run this code from my ...
Niek Jonkman's user avatar
0 votes
0 answers
141 views

How to check what is controlling/restarting a Windows Service or view its errors?

There are services which can be found in services.msc As example, WlanSvc the WLAN AutoConfig. How can I check which "thing" initiated a Stop or a Restart on a service? With "thing"...
karl-police's user avatar
0 votes
1 answer
4k views

Powershell Get-Service : how do I filter out the services that are disabled?

I'm trying to start multiple services using : Get-Service SERVICE* | Start-Service When Get-Service returns services that are disabled, I run into the following error : + CategoryInfo : ...
Sybuser's user avatar
  • 183
5 votes
2 answers
5k views

Only return state of a service when using sc.exe query

When using the following command to return information about a service to a file : sc.exe query MyService >> MyFileLocation\MyFile.txt I get the following information in the file : SERVICE_NAME:...
Niek Jonkman's user avatar
1 vote
0 answers
622 views

Windows Time Service is Missing

I have Windows 10 Pro installed on my PC. After the last update I have a problem with the time as it changes continuously either after startup or while using the PC. Searching online, I noticed that ...
El_Merendero's user avatar
-1 votes
1 answer
861 views

Some Services Not Showing With Get-Service cmdlet in Powershell

I am trying to compile a list of services on several different servers running Windows Server 2019. To do this I have been to outputting the service names using Get-Service in Powershell but on one of ...
Luke's user avatar
  • 279
1 vote
1 answer
2k views

Cannot enable or restart Windows Firewall

I am trying to fix some problems related to Windows Calculator, Clock, etc., but I encounter an error while trying to run the PowerShell command: Get-AppxPackage -allusers *windowscalculator* | ...
azure's user avatar
  • 11
0 votes
0 answers
614 views

Disable a device's service from powershell or command line

Just read the bold text for the basic rundown! I have a bluetooth headset that I use for gaming, however because it has a mic I have to disable the "handsfree telephony" service every time I pair the ...
Mark Deven's user avatar
  • 1,660
6 votes
3 answers
48k views

Powershell Get-AppxPackage not working

This is the error: Get-AppxPackage -AllUsers Get-AppxPackage : The service cannot be started, either because it is disabled or because it has no enabled devices associated with it. The service cannot ...
Steve Moretz's user avatar
0 votes
1 answer
3k views

Windows service : how to run a program with administrator privileges?

I would like to create a windows service that launches a Powershell script with administrator privileges. To do so, I used PowerGUI to transform my script into an exe file and I also used PowerGUI to ...
M.Brbr's user avatar
  • 149
0 votes
2 answers
4k views

Start and stop Windows services using PowerShell

I'm running both Apache (as a Windows service) and IIS 10, and would like to be able to toggle each of these services on or off, as they both grab port 80, and I don't wish to configure either to use ...
ProfK's user avatar
  • 2,651
8 votes
1 answer
16k views

How to Create Local Windows Desktop Service Accounts?

Question: In Windows Home / Professional, (Windows 10), what is the recommended way to create a Local Service Account? Is there any documentation for this? (Powershell, GUI, etc). Clarification: ...
elika kohen's user avatar
0 votes
0 answers
386 views

SETX not working when run as service

I have a service which invokes a batch file which runs a Powershell script which calls SETX to update an environment variable. The environment variable gets changed, but the change apparently isn't ...
Void Star's user avatar
  • 575

15 30 50 per page