Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
Kasyan #1
Member since Jul 2007 · 4 posts · Location: Russia
Group memberships: Members
Show profile · Link to this post
Subject: Run as service user
Hi!
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.
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
Avatar
Alex #2
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hello,

I think there is a security/policy problem.
Services normally run under the local system account, and this account normally has no permissions to access the network.
Can you check this and adjust your .NET policies or the user account?

Alex
Avatar
halr9000 #3
Member since Jan 2008 · 5 posts
Group memberships: Members
Show profile · Link to this post
If the solution will be that simple then you just change the service to NETWORK SERVICE as opposed to SYSTEM.
Author, TechProsaic (http://halr9000.com)
Co-Host, PowerScripting Podcast (http://powerscripting.net)
Webmaster, Psi (http://psi-im.org)
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP RSS