{"action":"created","issue":{"url":"https://api.github.com/repos/mickem/nscp/issues/252","repository_url":"https://api.github.com/repos/mickem/nscp","labels_url":"https://api.github.com/repos/mickem/nscp/issues/252/labels{/name}","comments_url":"https://api.github.com/repos/mickem/nscp/issues/252/comments","events_url":"https://api.github.com/repos/mickem/nscp/issues/252/events","html_url":"https://github.com/mickem/nscp/issues/252","id":136180094,"number":252,"title":"NSClient and Loading a PowerSHell Profile","user":{"login":"Klang0340","id":11839144,"avatar_url":"https://avatars.githubusercontent.com/u/11839144?v=3","gravatar_id":"","url":"https://api.github.com/users/Klang0340","html_url":"https://github.com/Klang0340","followers_url":"https://api.github.com/users/Klang0340/followers","following_url":"https://api.github.com/users/Klang0340/following{/other_user}","gists_url":"https://api.github.com/users/Klang0340/gists{/gist_id}","starred_url":"https://api.github.com/users/Klang0340/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Klang0340/subscriptions","organizations_url":"https://api.github.com/users/Klang0340/orgs","repos_url":"https://api.github.com/users/Klang0340/repos","events_url":"https://api.github.com/users/Klang0340/events{/privacy}","received_events_url":"https://api.github.com/users/Klang0340/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-24T20:37:34Z","updated_at":"2016-02-25T08:07:26Z","closed_at":null,"body":"Good afternoon all,\r\n\r\n      I'm looking for assistance in having NSClient load a PowerShell profile when it calls PowerShell. The profile is needed as it comes with a 'Get-ADUser' cmdlet allowing me to easily query Active Directory for account information. The problem is, I never attempted to have NSClient load a profile or IF this is possible. Below I have provided the profile line to be loaded with the PowerShell executeable and my best attempt at a registry setting for the NRPE command.\r\n\r\n**Profile to be loaded:** -psconsolefile \"C:\\Program Files\\Quest Software\\Management Shell for AD\\ConsoleSettings.psc1\" -noexit -command \". 'C:\\Program Files\\Quest Software\\Management Shell for AD\\qsft.ps1'\"\r\n\r\n**Registry Entry**: cmd /c echo scripts\\get_AD_account_info.ps1 $ARG1$ exit($lastexitcode) | powershell.exe -psconsolefile \"C:\\Program Files\\Quest Software\\Management Shell for AD\\ConsoleSettings.psc1\" -noexit -command \". 'C:\\Program Files\\Quest Software\\Management Shell for AD\\qsft.ps1'\" -command -"},"comment":{"url":"https://api.github.com/repos/mickem/nscp/issues/comments/188664022","html_url":"https://github.com/mickem/nscp/issues/252#issuecomment-188664022","issue_url":"https://api.github.com/repos/mickem/nscp/issues/252","id":188664022,"user":{"login":"mickem","id":1434697,"avatar_url":"https://avatars.githubusercontent.com/u/1434697?v=3","gravatar_id":"","url":"https://api.github.com/users/mickem","html_url":"https://github.com/mickem","followers_url":"https://api.github.com/users/mickem/followers","following_url":"https://api.github.com/users/mickem/following{/other_user}","gists_url":"https://api.github.com/users/mickem/gists{/gist_id}","starred_url":"https://api.github.com/users/mickem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mickem/subscriptions","organizations_url":"https://api.github.com/users/mickem/orgs","repos_url":"https://api.github.com/users/mickem/repos","events_url":"https://api.github.com/users/mickem/events{/privacy}","received_events_url":"https://api.github.com/users/mickem/received_events","type":"User","site_admin":false},"created_at":"2016-02-25T08:07:26Z","updated_at":"2016-02-25T08:07:26Z","body":"Havent read the thread but are you looking for info on how to configure how powershell scripts are started?\r\n\r\nIt would depend on whether you using \"wrapped\" or not.\r\n\r\nI recently did this change to the default wrapping to make it not use the default profile: https://github.com/mickem/nscp/commit/11d759f5d8d6a1dd16a87599b644eefc923a1e4c\r\n\r\nSo that might give you some details on how to configure nsclient++ correctly.\r\n\r\nThere is also a guide in the docs for how to setup powershel lscript IIRC.\r\n"}}