Get-VpnConnection reports `Invalid class` - powershell

I am running PSVersion 5.1.14393.206. Is there something that I must configure or call before Get-VpnConnection?
PS C:\Users\pwatson> Get-VpnConnection -AllUserConnection
Get-VpnConnection : Invalid class
At line:1 char:1
+ Get-VpnConnection -AllUserConnection
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : MetadataError: (PS_VpnConnection:root/Microsoft/...S_VpnConnection) [Get-VpnConnection], CimException
+ FullyQualifiedErrorId : HRESULT 0x80041010,Get-VpnConnection
Same result in 64-bit and 32-bit shell.

if you doesn't have VPN connection use you will get error but if u have use this :
Get-VpnConnection
your output will your VPN information .
you don't need any thing for this service .

Related

How to fix Storage Module Cmdlet when they can't run on Powershell Windows 10

Any one know How to fix Storage Module Cmdlets when then can't run on powershell over Windows 10 ?
I have try all Cmdlets like get-disk , get-volume but all gives the following massage
PS C:\Users\administrator.HUPCHONGFURNITU\Documents> get-volume
get-volume : Invalid property
+ CategoryInfo : MetadataError: (MSFT_Volume:ROOT/Microsoft/...age/MSFT_Volume) [Get-Volume],
CimException
+ FullyQualifiedErrorId : HRESULT 0x80041031,Get-Volume
PS C:\Users\administrator.HUPCHONGFURNITU\Documents> Get-Disk
Get-Disk : Invalid property
+ CategoryInfo : MetadataError: (MSFT_Disk:ROOT/Microsoft/Windows/Storage/MSFT_Disk) [Get-Disk],
CimException
+ FullyQualifiedErrorId : HRESULT 0x80041031,Get-Disk

How to check if VMHost is configured with Syslog forwarding

I want to check if VMHost is configured with Syslog forwarding
I have written the following cmdlets but it is not giving "Syslog forwarding" status.
$esxcli = Get-EsxCli -VMHost abc.com
$esxcli.system.syslog | Select-Object *
$esxcli.system.syslog | gm is returning an error
gm : You must specify an object for the Get-Member cmdlet.
At line:1 char:25
+ $esxcli.system.syslog | gm
+ ~~
+ CategoryInfo : CloseError: (:) [Get-Member], InvalidOperationException
+ FullyQualifiedErrorId : NoObjectInGetMember,Microsoft.PowerShell.Commands.GetMemberCommand
$esxcli.system.syslog.config.get() is returning an error:
You cannot call a method on a null-valued expression.
At line:1 char:1
+ $esxcli.system.syslog.config.get()
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
PowerCLI includes the Get-VMHostSysLogServer cmdlet. In the context of your question, this command would return the Syslog Server for the VMHost abc.com:
Get-VMHostSysLogServer -VMHost abc.com

Invalid namespace in PowerShell working with FSRM

Trying PS command:
Set-FsrmFileGroup -Name "Anti-Ransomware File Groups" -IncludePattern #((Invoke-WebRequest -Uri "https://fsrm.experiant.ca/api/v1/combined" -UseBasicParsing).Content | ConvertFrom-Json | % {$_.filters})
Getting error:
New-FsrmFileGroup : Invalid namespace
At line:1 char:1
+ New-FsrmFileGroup -Name "Anti-Ransomware File Groups" -IncludePattern #((Invoke- ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : MetadataError: (MSFT_FSRMFileGroup:Root/Microsoft/...T_FSRMFileGroup) [New-FsrmFileGroup], CimException
+ FullyQualifiedErrorId : HRESULT 0x8004100e,New-FsrmFileGroup
I also notice some errors in FSRM:
Firewall is off and I am domain admin running this as admin. SFC and a WMI repair came back as good. I am going based off a guide (https://fsrm.experiant.ca/). This has worked across a ton of other servers so I don't believe the commands to be improperly formatted.
Output of Get-WmiObject -Namespace 'Root/Microsoft/Windows/Fsrm' -List:
Get-WmiObject : Could not get objects from namespace Root/Microsoft/Windows/Fsrm.
Invalid namespace
At line:1 char:1
+ Get-WmiObject -Namespace 'Root/Microsoft/Windows/Fsrm' -List
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (:) [Get-WmiObject], ManagementException
+ FullyQualifiedErrorId : INVALID_NAMESPACE_IDENTIFIER,Microsoft.PowerShell.Commands.G‌​etWmiObjectCommand

Exporting Managed Properties in SharePoint 2010 via a PowerShell script

I’m running this script I found on technet.
Export Managed/Crawled Properties from Enterprise Search
https://gallery.technet.microsoft.com/office/Export-ManagedCrawled-7548d31b
Why am I receiving the following error below?
PS C:> .\Export-SpSearchManagedProperties.ps1
Get-SPEnterpriseSearchMetadataManagedProperty : SearchApplication Search Service not found.
At C:\Staging\Export-SpSearchManagedProperties.ps1:14 char:67
+ $ManagedPropreties = Get-SPEnterpriseSearchMetadataManagedProperty <<<< -SearchApplication $SearchServiceApp
+ CategoryInfo : InvalidData: (Microsoft.Offic...ManagedProperty:GetSearchMetadataManagedProperty) [Get-S
PEnterpris...ManagedProperty], KeyNotFoundException
+ FullyQualifiedErrorId : Microsoft.Office.Server.Search.Cmdlet.GetSearchMetadataManagedProperty
You cannot call a method on a null-valued expression.
At C:\Staging\Export-SpSearchManagedProperties.ps1:28 char:32
+ $Mappings = $MP.GetMappings <<<< ()
+ CategoryInfo : InvalidOperation: (GetMappings:String) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
You cannot call a method on a null-valued expression.
At C:\Staging\Export-SpSearchManagedProperties.ps1:33 char:29
+ if ($CP.Contains <<<< (":") -eq $true){
+ CategoryInfo : InvalidOperation: (Contains:String) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
PS C:>
=======================================================================
Environment –
Windows Server 2008 R2 Datacenter
64-bit
$PSVersionTable
Name Value
PSVersion 2.0
$host
Name : ConsoleHost
Version : 2.0
UI : System.Management.Automation.Internal.Host.InternalHostUserInterface
Get-SPEnterpriseSearchServiceInstance -local
TypeName : SharePoint Server Search
Description : Index content and serve search queries
Role : None
Status : Online
I believe I found the issue. I needed to change the parameter for $SearchServiceApp to "Search Service Application".

What causes error message 0x800700EA with PowerShell Remoting

The situation: I want to setup PowerShell remoting (it's working on my other 2 machines).
I run:
winrm quickconfig
Result:
winrm : WSManFault
At line:1 char:1
+ winrm quickconfig
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (WSManFault:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
Message
ProviderFault
WSManFault
Message = More data is available.
Error number: -2147024662 0x800700EA
More data is available.
I am also wondering where the 'More data' can be found?
PS F:\powershell\Text\SEO> Enable-PSRemoting -Force
WinRM is already set up to receive requests on this computer.
Set-WSManQuickConfig : More data is available.
At line:69 char:17
+ Set-WSManQuickConfig -force
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Set-WSManQuickConfig], InvalidOperationException
+ FullyQualifiedErrorId : WsManError,Microsoft.WSMan.Management.SetWSManQuickConfigCommand