Let’s create an example.
DECLARE @cTimeStamp CHAR(25) SELECT @cTimeStamp = DATEADD(MINUTE, -1, GETDATE()) SELECT CONVERT(TIME, GETDATE() - @cTimeStamp) AS [Duration]
Combines the output to
Duration
——–
00:01:49.6930000
Let’s create an example.
DECLARE @cTimeStamp CHAR(25) SELECT @cTimeStamp = DATEADD(MINUTE, -1, GETDATE()) SELECT CONVERT(TIME, GETDATE() - @cTimeStamp) AS [Duration]
Combines the output to
Duration
——–
00:01:49.6930000
After getting the following error:
The error information returned by PowerShell is: ‘Access is denied.
This allows me to run the following as the user.
Get-WmiObject Win32_logicaldisk -ComputerName MYSRVNAM |? {$_.DeviceID -eq "E:" -or $_.DeviceID -eq "F:" -or $_.DeviceID -eq "G:" -or $_.DeviceID -eq "H:" } ` | Format-Table SystemName, DeviceID, MediaType, ` @{Name="Size(GB)";Expression={[decimal]("{0:N0}" -f($_.size/1gb))}}, ` @{Name="Free Space(GB)";Expression={[decimal]("{0:N0}" -f($_.freespace/1gb))}}, ` @{Name="Free (%)";Expression={"{0,6:P0}" -f(($_.freespace/1gb) / ($_.size/1gb))}} ` -AutoSize | Out-String
Thanks to the original source!
Here are several ways to search for a string in one column in another. The last one worked the best for me, looking for column E in column C.
Just past in the first row of column D1 and copy down.
=NOT(ISNA(MATCH($K1,$G$1:$G$99504,0)))
=COUNTIF($K$1:$K$99504,$G1)>0
=COUNTIF($C1,”*” & $E1 & “*”)>0
PowerShell error:
Remoting needs to be set up on [ServerName]
Try running winrm quickconfig on remote server.
Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. DOS;winrm quickconfig WinRM already is set up to receive requests on this machine. WinRM is not set up to allow remote access to this machine for management. The following changes must be made: Create a WinRM listener on HTTP://* to accept WS-Man requests to any IP on this machine. Enable the WinRM firewall exception. Make these changes [y/n]? y WinRM has been updated for remote management. Created a WinRM listener on HTTP://* to accept WS-Man requests to any IP on this machine. WinRM firewall exception enabled.