Skip to content

Instantly share code, notes, and snippets.

@Vibhu2
Vibhu2 / Get-PhysicalInterfaceInfo.ps1
Last active February 23, 2024 11:08
this function gets details about comouter name,ip,static or dynamic and its dhcp server
function Get-PhysicalInterfaceInfo {
[CmdletBinding()]
param()
begin {
$computerName = $env:COMPUTERNAME
#Write-Output ("Computer Name: $computerName")
$interfaceInfo = @()
}
Checking for auto start on VMS
$AutostartStatus= Get-VM | Select-Object VMname,AutomaticStartAction,AutomaticStartDelay,AutomaticStopAction
#$AutostartStatus | where-Object { ($_.AutomaticStartAction -ine 'Start') -or ($_.AutomaticStartAction -ine 'StartIfRunning')}
$vmstostart= $AutostartStatus | where-Object { ($_.AutomaticStartAction -eq 'Nothing')}
# starting Back Virtul Machines
Write-verbose "Getting status of VM's from the log file"
$InetiallyRunningMachines= Get-Content -Path C:\HypervisorRestartLogs\RunningMachines.txt
Get-Date | Out-File -FilePath C:\HypervisorRestartLogs\Logfiles.txt -Append
$Cleanup=Test-Path -Path "C:\HypervisorRestartLogs\*.txt"
if ($Cleanup -eq 'True') {
Remove-Item -Path C:\HypervisorRestartLogs\*.txt
}
# Creating Log files
New-Item C:\HypervisorRestartLogs -ItemType Directory -ErrorAction SilentlyContinue
New-Item C:\HypervisorRestartLogs\Logfiles.txt -ItemType File -ErrorAction SilentlyContinue
Get-Date | Out-File -FilePath C:\HypervisorRestartLogs\Logfiles.txt -Append
DisplayName
-----------
7-Zip 21.07 (x64)
Microsoft 365 Apps for enterprise - en-us
Microsoft OneDrive
OpenVPN 2.4.8-I602-Win10
Sentinel Agent
TAP-Windows 9.24.2
Dell Optimizer
Dell Power Manager Service
DomainService.exe install
DomainService.exe clientguid 694af836-e5f8-484f-a177-09357b3039f5
DomainService.exe start
DomainService.exe domainguid
DomainService.exe OU value
DomainService.exe friendlyname %CS_PROFILE_NAME%
DomainService.exe rmmname
DomainService.exe displayname
DomainService.exe username
DomainService.exe