Start Manual Import Connector Powershell
$connector = get-scsmconnector -displayname "connector name"
$connector.enabled = $True
Update-Scsmconnector -connector $connector
The ultimate aim here is to be able to use file change notifications to monitor for changes to the csv mapped to the connector and start the import process.
Best Answers
-
john_doyle Cireson Support Ninja IT Monkey ✭✭✭✭It's been a while since this question was raised, but I guess better late than never.
This code should do the trick assuming that the connector is already enabled.$connector = Get-SCSMObject -Class (Get-SCSMClass Cireson.AssetManagement.Import.Connector$) |?{$_.DisplayName -eq "Connector Name"}<br>Set-SCSMObject $connector -Property RunNow -Value True
7
Answers
Try this:
$Connector = Get-SCSMConnector -DisplayName "Connector Name"
Set-SCSMObject $Connector.ConnectorObject -Property Enabled -Value $true
Start-SCSMConnector $Connector
Set-SCSMObject $Connector.ConnectorObject -Property Enabled -Value $false
You may need to put a wait command between starting and disabling the connector.
If can't get this to work I'll just stick to using Orchestrator/Powershell to create the objects
Yes, I have the same results. I've tried enabling a connector using the UI and it seemed to take a few seconds.
I suspect either there's a follow-on action that we need to trigger, or it just takes a lot longer for the connector to enable.
I'll test adding a sleep command after enabling the connector and post the results.
Results are in. There's an action that doesn't get triggered when using the
Set-SCSMObject $Connector.ConnectorObject -Property Enabled -Value $true
command, but does when using the GUI.More investigation required.
This code should do the trick assuming that the connector is already enabled.