Subject: Run as service user
Hi!
I use a this library in Windows PowerShell script to send a Jabber-message.
Look at this script:
But, my task is start this script from service that run from other domain user - and it doesn't work
I don't understand what wrong: assembly don't load or something other..
Please help me
I use a this library in Windows PowerShell script to send a Jabber-message.
Look at this script:
function fn_jabbersend ($text_mess)
{
[Reflection.Assembly]::LoadFile("c:\cmo\care\agsXMPP.dll")
$jcon=new-object agsxmpp.xmppclientconnection("jabber.vz")
$jcon.open("user","pass")
$jmess=new-object agsxmpp.protocol.client.message()
$data_file=Get-Content data.list
foreach ($one_str in $data_file)
{
if ($one_str -match "([\w\-]+\.)*[\w\-]+(@jabber.vz)") # if it is a JID
{
$jmess.to=$one_str
$jmess.body=$text_mess
$jcon.send($jmess)
}
}
}
$jcon.close()
}
It works perfectly from my user account. My account is domain user, I'm not a computer administrator.{
[Reflection.Assembly]::LoadFile("c:\cmo\care\agsXMPP.dll")
$jcon=new-object agsxmpp.xmppclientconnection("jabber.vz")
$jcon.open("user","pass")
$jmess=new-object agsxmpp.protocol.client.message()
$data_file=Get-Content data.list
foreach ($one_str in $data_file)
{
if ($one_str -match "([\w\-]+\.)*[\w\-]+(@jabber.vz)") # if it is a JID
{
$jmess.to=$one_str
$jmess.body=$text_mess
$jcon.send($jmess)
}
}
}
$jcon.close()
}
But, my task is start this script from service that run from other domain user - and it doesn't work

I don't understand what wrong: assembly don't load or something other..
Please help me
Kasyan
Show profile
Link to this post
