March 2018

Thursday, March 29, 2018

Shutdown, Restart Computer Remotely




 Shutdown :by using PowerShell UAC “Windows administrators periodically” promotion press “start + R “ and write
“powershell start-process powershell -verb runas”

Stop Computer SYNTAX

Stop-Computer [[-ComputerName] <string[]>] [[-Credential] <pscredential>] [-AsJob] [-DcomAuthentication {Default |
    None | Connect | Call | Packet | PacketIntegrity | PacketPrivacy | Unchanged}] [-WsmanAuthentication {Default |
    Basic | Negotiate | CredSSP | Digest | Kerberos}] [-Protocol {DCOM | WSMan}] [-Impersonation {Default | Anonymous
    | Identify | Impersonate | Delegate}] [-ThrottleLimit <int>] [-Force] [-WhatIf] [-Confirm]  [<CommonParameters>]

·         Computer Name: Target Computer or specifies the computers to stop. The default is the local computer.
·         Credential: Type a user name, such as User01 or Domain01\User01, or enter a PSCredential object, such as one from the Get-Credential cmdlet.
·         AsJob: When you specify the AsJob parameter, the command immediately returns an object that represents the background job. You can continue to work in the session while the job finishes. The job is created on the local computer and the results from remote computers are automatically returned to the local computer. To get the job results, use the Receive-Job cmdlet.
·         Confirm: Prompts you for confirmation before running the cmdlet.
·         DcomAuthentication: uses WMI. The acceptable values for this parameter are:
o   Default. Windows Authentication
o   None. No COM authentication
o   Connect. Connect-level COM authentication
o   Call. Call-level COM authentication
o   Packet . Packet-level COM authentication
o   PacketIntegrity. Packet Integrity-level COM authentication
o   PacketPrivacy. Packet Privacy-level COM authentication
o   Unchanged. Same as the previous command
·         Force: Forces an immediate shut down of the computers
·         Impersonation: Stop-Computer uses WMI. The acceptable values for this parameter are:
o   Default. Default impersonation.
o   Anonymous. Hides the identity of the caller.
o   Identify. Allows objects to query the credentials of the caller.
o   Impersonate. Allows objects to use the credentials of the caller.
·         Protocol: Specifies which protocol to use to restart the computers. The acceptable values for this parameter are: WSMan and DCOM. The default value is DCOM. (PowerShell v3)
·         ThrottleLimit : Specifies the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0, the default value, 32, is used.
·         WhatIf: Shows what would happen if the cmdlet runs. The cmdlet is not run

Description


Example 1:
PS C:\> Stop-Computer
This Command Stop local computer
Example 2:
PS C:\> Stop-Computer -ComputerName "Server01", "Server02", "localhost"
This command stops two remote computers, Server01 and Server02, and the local computer, identified as localhost.
Example 3:
PS C:\> Stop-Computer -ComputerName "Server01" -Impersonation Anonymous -Authentication PacketIntegrity
This command stops the Server01 remote computer. The command uses customized impersonation and authentication settings.
Example 4:
PS C:\> Stop -computer (get-content c:\work\computers.txt) -credential "mycompany\administrator"
You’ll get prompted for the password, but then this credential will be used for every computer in the list.
This might fail if you have someone logged on to the computer. In such cases you will receive below error.      
PS C:\> Stop-Computer -ComputerName Server01
Stop-Computer : This command cannot be run on target computer(‘Server01) due to following error: The system shutdown
cannot be initiated because there are other users logged on to the computer.
At line:1 char:1
+ Stop-Computer -ComputerName Server01
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Server01:String) [Stop-Computer], InvalidOperationException
+ FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StopComputerCommand


The solution in this is to use -Force switch to the above command.

PS C:\> Stop-Computer -ComputerName “Server01” –Force

Thursday, March 1, 2018

Battery icon missing on Taskbar windows ten



Battery icon missing on Taskbar windows 10 

Sometimes windows 10 something unknown happen for unknown resin -If you want to know check system reports – for example power meter in taskbar gone, for unknown
Here some method to solve that

Method 1:

Check if it’s a prank go to taskbar setting make sure power system icon is on or enable sometimes is unchangeable for some error in the system




It could be also group policy prank Check group policy on Windows and R keys, gpedit.msc and then check User Configuration à Start Menu and Taskbar search forà remove the battery meter 


This policy setting allows you to remove the battery meter from the system control area.
  • If you enable this policy setting, the battery meter is not displayed in the system notification area.
  • If you disable or do not configure this policy setting, the battery meter is displayed in the system notification area.


Method 2:
Run the System File Checker tool and check if that helps you.

Method 3:
Refer to these steps and check if that helps you.
Windows and R keys, type Devmgmt.msc and then press Enter key to open Device Manager.
In the Device Manager, expand Batteries. Right-click on Microsoft AC Adapter entry and click Uninstall button. Click OK button when you see the warning message to continue uninstalling the driver.
Next, click on Action menu and then click Scan for hardware changes option to restore the missing battery icon.

Method 4:
You may create a new user account and check if the issue occurs in the new user account. This will help us to diagnose the issue.
Press “Windows key + X” and click on “Control Panel”.
Click on “User Accounts” and click on “Manage another Account”.
Click on “Add a new user in PC Settings”. Follow the on screen directions to complete the process.
Once this is done, login to the new user account and check if the issue occurs in the new user account.