Applescript - Access to remote machines

Hi,
I am currently writing an applescript that will activate remote login and remote management from system preferences AND add the admin account under "Allow access for:"
Here is what I currently have,
tell application "System Preferences"
  activate
          delay 0.5
          set current pane to pane "com.apple.preferences.sharing"
end tell
delay 0.5
tell application "System Events" to tell process "System Preferences"
  click checkbox 1 of row 7 of table 1 of scroll area 1 of group 1 of window "Sharing"
          delay 0.3
  click checkbox 1 of row 8 of table 1 of scroll area 1 of group 1 of window "Sharing"
          delay 0.3
end tell
This succesfully activates both remote login and remote management but I can't seem to find out how to click the "+" button under these tabs, or then add the correct user.
Any help would be appreciated.

Here's the full script for adding a user to the Sharing > Remote Management list with all permissions:
tell application "System Events" to tell process "System Preferences"
          set frontmost to true
keystroke tab
keystroke tab
click button 1 of group 1 of group 1 of window 1
          select (row 1 where value of text field 1 is "yourusername") of table 1 of scroll area 2 of splitter group 1 of sheet 1 of window 1
keystroke return
          delay 0.5
          click checkbox "Observe" of sheet 1 of window 1
          click checkbox "Control" of sheet 1 of window 1
          click checkbox "Show when being observed" of sheet 1 of window 1
          click checkbox "Generate reports" of sheet 1 of window 1
          click checkbox "Open and quit applications" of sheet 1 of window 1
          click checkbox "Change settings" of sheet 1 of window 1
          click checkbox "Delete and replace items" of sheet 1 of window 1
          click checkbox "Start text chat or send messages" of sheet 1 of window 1
          click checkbox "Restart and shut down" of sheet 1 of window 1
          click checkbox "Copy items" of sheet 1 of window 1
keystroke return
end tell

Similar Messages

  • Accessing any remote machine

    how can i access any remote machine connected via a LAN for I/O oprations on Wndows platform, Could it be possible? i'v IP address.

    via a LAN for I/O oprations on Wndows platformThe easiest way (assuming the I/O operations are file operations) would be to set
    up a share on the remote machine and access it using File as usual.import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileReader;
    import java.io.IOException;
    public class LanTest {
        public static void main(String[] args) throws IOException {
            File file = new File("//10.144.32.13/jdctest$/message.txt");
            BufferedReader in = new BufferedReader(new FileReader(file));
            System.out.println(in.readLine());
    }

  • Trouble accessing a remote machine via ARD over a VPN

    Hi There,
    I'm having  trouble accessing a remote Workstation via ARD over a VPN.
    The VPN is set up and I can:
    - Control our 10.6 server via ARD remotely
    - Mount volums from the 10.6 server remotely
    - Access another server (we run an accounting server) remotely
    But we can't access a Workstation using ARD.
    I can connect to the Workstation when in the office so assume it's configured for access - I guess I suspect the issue lies with the Firewall on the 10.6 server and/or the Netgear FSV366G Firewall.
    The VPN is setup on the 10.6 server so figure it's something to do with Snow Leopard server?
    I'm just not sure how to narrow things down and fix the issue - although I setup the server I'm not super Unix savvy.
    Any help or pointers in the right direction would be much appreciated.
    Cheers
    Ben

    I can't say for certain what is going wrong in your case but I can confirm it is possible to do an ARD connection i.e. Screen Sharing to a remote user connected via a VPN. The way we do this is to get the user to connect to the VPN server (a Mac OS X Server), then on the Mac OS X Server in Server Admin see what IP address they have been allocated by the VPN server, then tell ARD Admin to connect to that IP address.
    This works fine for me.
    The IP address will be a 'local'  to the ARD and VPN machines IP address it would not be the remote public or private IP addresses.

  • Not able to access database from a remote machine using SQL Server Management Studio

    Hi,
    I have a DB_BOX with SQL Server 2008 R2 installed. I can access the databases on the local machine using SQL Server Management Studio but it is not accessible from other machines, though the machines are in same domain.
    I have remote enabled on SQL Server box, TCP enabled, firewall off. I checked with IP Address too, all SQL Server services are running.
    The SQL Server log shows the message
    The requested service has been stopped or disabled and is unavailable at this time. The connection has been closed.
    I get the below message in SSMS from remote machine.
    Details of error message are
    ===================================
    Cannot connect to DB_BOX.
    ===================================
    A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - The specified network name is no longer available.) (.Net SqlClient Data Provider)
    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=64&LinkId=20476
    Server Name: DB_BOX
    Error Number: 64
    Severity: 20
    State: 0
    Program Location:
       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
       at System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)
       at System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult asyncResult, TdsParserStateObject stateObj)
       at System.Data.SqlClient.TdsParserStateObject.ReadNetworkPacket()
       at System.Data.SqlClient.TdsParserStateObject.ReadBuffer()
       at System.Data.SqlClient.TdsParserStateObject.ReadByte()
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
       at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
       at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
       at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
       at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
       at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
       at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
       at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
       at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
       at System.Data.SqlClient.SqlConnection.Open()
       at Microsoft.SqlServer.Management.SqlStudio.Explorer.ObjectExplorerService.ValidateConnection(UIConnectionInfo ci, IServerType server)
       at Microsoft.SqlServer.Management.UI.ConnectionDlg.Connector.ConnectionThreadUser()

    Sorry, missed the message from the errorlog in the original post. You shouldn't have included that big .Net dump that hid the important facts. :-)
    My first Google attempt on that message (which I have never seen before) suggests that the TCP Enpoint is stopped, so try this:
    ALTER ENDPOINT [TSQL Default TCP]
    STATE=STARTED;
    Erland Sommarskog, SQL Server MVP, [email protected]
    This solves the problem. Thanks...

  • Using MS Access as Database from Remote Machine

    Hi All
    I am trying to use MS access as Data base, I have done the following.
    1. I have Added the mdb file on a remote machines DSN.(Control Panel->Admin Tools->ODBC->System Tools)
    2. In xMII data services->Data Servers, Copied the Default IDBC Server, renamed it and updated the ServerURL as  jdbc:inetdae:<IP of Remote machine>:1433?database=<DB Name>&sql7=true.
    With these things done, I am not able to get the Data Server Accesible.
    Please correct what mistake I have made.
    Thanks and Regards
    Rupesh

    Rupesh,
    First Access is not a very good database... I would suggest using MSSQL, MySQL, or some other 'real' database. But I digress...
    The only supported way to get the data you want from Access is by... you guessed it... the <b>xMII OLEDB UDS</b>. Sure you could try the JDBC - ODBC bridge, but this seems to be shaky.
    Martin - seriously... I'm trying to get the UDSs out to all of you!

  • Accessing a XML file located in a remote machine.

    I have a XML file located in a remote machine(source machine), and I want to be able to move the data from that file to a remote database (target).
    I have a central ODI deployment and a central master and worker repository.
    The issue I have is that it seams to me that in order to use an XML file the XML file needs to be local to the ODI client(topology manager, designer etc).
    The question what do I need to do in order to access the file located in the remote source machine if that machine does not have an ODI client?
    Thanks

    Hi Terence,
    why don't you try to put all your JPA stuff (classes, persistence.xml, etc) in a "library" jar file and then deploy it inside your .war (under META-INF/lib) and .ear (under the lib)?
    Is it acceptable for your purpose?
    Fabio De Santi

  • Psexec shows Access denied when i execute a .exe file on a remote machine

    Hi All,
    I am using Psexec application to run exe on multiple remote machines in the domain. When i run the the .EXE i get the error message saying access is denied.
    I am running this script against agents in a list.
    Below is the script i am running in the batch:
    "C:\Windows\system32\PsExec.exe" @C:\Test.txt cmd
    1. I am first connecting to the cmd of the remote computer and it connects successfully.
    2. When i enter the .exe file location on the command prompt (which is also in a shared drive but in the same domain).
    3. I ran the batch file as Run as administrator
    4. I am itself a member of the Domain admins and Administrators group of the domain.
    5. Turned off firewall on both sides.
    6. Turned off UAC fully as per the below MS article - http://technet.microsoft.com/en-us/library/cc709691(v=ws.10).aspx
    7. Pressed shift and right click so i will get the Run as option and mentioned different domain admins user account and password.
    Below is the screenshot for your reference: 
    Restated both the machines after doing these changes. But still the same issue.
    But still i get access is denied. Can anyone please help.
    Gautam.75801

    Few days back when i used to run the same task in this Access is denied mode its self. My destination server used to give a Audit failure event log as below.
    Now a days this event log does not come.
    Can this help for analysis.
    Subject:
    Security ID:
     Domain name\My username
    Account Name:
     Gautamr
    Account Domain:
    My Domain
    Logon ID:
     0x234992
    Object:
    Object Server:
    Security
    Object Type:
     File
    Object Name:
     C:\Windows\System32\eventvwr.msc
    Handle ID:
     0x0
    Process Information:
    Process ID:
     0x17e0
    Process Name:
     C:\Windows\System32\mmc.exe
    Access Request Information:
    Transaction ID:
    {00000000-0000-0000-0000-000000000000}
    Accesses:
     READ_CONTROL
    SYNCHRONIZE
    WriteData (or AddFile)
    AppendData (or AddSubdirectory or CreatePipeInstance)
    WriteEA
    ReadAttributes
    WriteAttributes
    Access Reasons:
    READ_CONTROL:
    Granted by
    D:(A;;0x1200a9;;;BA)
    SYNCHRONIZE:
     Granted by
    D:(A;;0x1200a9;;;BA)
    WriteData (or AddFile):
    Not granted
    AppendData (or AddSubdirectory or CreatePipeInstance):
    Not granted
    WriteEA:
     Not granted
    ReadAttributes:
    Granted by ACE on parent folder
    D:(A;;0x1301bf;;;BA)
    WriteAttributes:
    Not granted
    Access Mask:
     0x120196
    Privileges Used for Access Check:
    Restricted SID Count:
    0
    Gautam.75801

  • Cannot connect to a named instance using SSMS from a remote machine

    Hi all,
       SQL Server.....: 2012 EE
       OS...................:  Windows Server 2008 R2
       I have a desktop machine, that i am using to administrer SQL Server (via SSMS) and to develop my SSIS solutions, but i can't connect to a named instance of my SQL Server. When i try to connect using SSMS to my named instance (myhost\DWSERVER)
    i get a huge error message:
    A network-related or instance-specific error occurred while establisinh a connection to SQL Server. The server was not found or was not accessible. Verify that the instance is correct and that SQL Server is configured to allow remote connections.
    (provider: TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.) (Microsoft SQL Server, Error: 10060)
    Locally, i am able to access that named instance using SSMS, just when i try to access from another machine, the above error pops-up to me.
    I am using the SQL Server Authentication mode to connect to the named instance.
    What am i doing wrong?
    Thanks in advance.
    Fabrício Pedroso Jorge Database Administrator - Belém, Pará, Brazil

    Hi,
       thanks for your attention.
       That's correct, i can connect to my default instance both locally and remotelly. The default instance in on port 1433. I cannot find the port used by the named instance (DWSERVER).
       Actually, i found this on the errorlog from the named instance:
       2015-03-22 10:10:45.80 spid13s     Server is listening on [ 'any' <ipv6> 49411].
       2015-03-22 10:10:45.80 spid20s     Server is listening on [ 'any' <ipv6> 5023].
       2015-03-22 10:10:45.81 spid20s     Server is listening on [ 'any' <ipv4> 5023].
       2015-03-22 10:10:45.81 spid20s     The Database Mirroring endpoint is now listening for connections.
       2015-03-22 10:10:46.12 spid13s     Server is listening on [ 'any' <ipv4> 49411].
       2015-03-22 10:10:46.25 spid13s     Server local connection provider is ready to accept connection on [ \\.\pipe\SQLLocal\DWSERVER ].
       2015-03-22 10:10:46.26 spid13s     Server local connection provider is ready to accept connection on [ \\.\pipe\MSSQL$DWSERVER\sql\query ].
       2015-03-22 10:10:46.26 Server      Server is listening on [ ::1 <ipv6> 49412].
       2015-03-22 10:10:46.26 Server      Server is listening on [ 127.0.0.1 <ipv4> 49412].
       I can ping normally to the remote server.
    Fabrício Pedroso Jorge Database Administrator - Belém, Pará, Brazil

  • I have an Ipad 2 and here is what I am trying to accomplish.  On my laptop I connect to a remote desktop connection to access a shared program we use for reporting.  How do I set up my Ipad to access this remote server?  Thanks for the help.

    I have an Ipad 2 and here is what I am trying to accomplish.  On my laptop I connect to a remote desktop connection to access a shared program we use for reporting.  How do I set up my Ipad to access this remote server?  Thanks for the help.

    Close ... before going for a specific Cisco app ... lets find out some details:
    Host we need more details:
    What is your server environment (Windows Server, or Mac OS X Server, or Linux)?
    What security is implemented in your environment - as what is restricted (RDP for all or specifc credentials on all machines? Are you part of local admin group to the server you wish to connect)?
    Does your environment Support CISCO IPSec connection? If so use Settings> VPN and IPSec tab to enter VPN details, if not then go with above suggestion. IF your restricted to RSA then either built in VPN settings or 3rd party app for RSA would suffice.
    Finally, there are many RDP applications out there I use "Mocha RDP Light" (free minimal ads when launched not when connecting).

  • Program to open file in remote machine

    Hi,
    i want to write a program in which i can access a file in another system.
    But the catch here is that the other system is using password to login to the system.
    How i can provide password through my Java Program to access to other machine
    ~Aman

    Can you just send me the code how to read file from Shared folder/drive through java program?
    e.g ="\\mcno-pc180\shared\HelloWorld.txt". I am able to access file HelloWorld.txt from my machine which is placed in shared folder path "\\mcno-pc180\shared\".
    Regards
    SPulluri
    Share the folder/drive which you want to access on the remote machine then your application can access it.
    Try to use the user which has already rights of reading/writing to that machine then the security dialog will not appear.

  • Update-Help error when console application is run in remote machine via PS remoting

    Hello,
    When I execute a particular console application in a remote machine via PS remoting, I get an error related to update-help. When I execute it directly on the remote machine, it works...
    My code:
    $credential = Get-Credential -Credential "DomainName\AccountName"
    $session = New-PSSession -ComputerName "MachineName" -Authentication Credssp -Credential $credential;
    Invoke-Command -session $session -ScriptBlock {
    try{
    cd <network share location>
    .\theConsoleApp.exe | Out-File C:\console-output.txt
    $error | Out-File C:\console-error-output.txt
    $exitCode
    } catch {
    throw $error
    Error seen in the console:
    NetNat, PcsvDevice, PSDesiredStateConfiguration, SoftwareInventoryLogging, StartScreen, TLS, WindowsSearch' with UI culture(s) {en-US} : Unable to retrieve the HelpInfo XML file for
    UI culture en-US. Make sure the HelpInfoUri property in the module manifest is valid or check your network connection and then try the command again.
    $error variable from above:
    Errored out (exit code 1603) with error message: ErrorId 10010: Xpatch threw an unexpected exception: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
    I’ve tried
    two different user accounts
    multiple file share locations
    different OSs
    different target servers
    but have not determined the cause of the error.
    I would appreciate any help on this.
    -Rohan.

    Clearly the remote EXE cannot run in that context.  YOU should not run that program remotely.
    I suspect there is also information you are not giving to us.
    ¯\_(ツ)_/¯

  • How to retrive data through stored procedure in mysql from remote machine?

    Hello everybody,
    I am having problem in accessing data of mysql through stored procedure. It works fine if I use "jdbc:mysql://localhost:3306/[database name]" instead of "jdbc:mysql://[IP address]:3306/[database name]". The connection is fine for both, but when stored procedure is called the system stops at "stmt.execute();" line in java file while debuging. In case of localhost there is no any problem. The code for connecting procedure is:
    stmt = dbConn.prepareCall("{? = call testing()}"); stmt.registerOutParameter(1, Types.VARCHAR); stmt.execute();
    I have to connect java application running in Windows to the mysql database running in remote machine(RHEL 5).
    I am using "mysql-connector-java-5.1.5-bin.jar", jdk 1.5.0 and remote database Mysql version : 5.0.22.
    There is no exception and application hangs at stmt.execute();
    Can anybody help me with this problem?
    Thank you.

    I got it. its about connection...

  • Creating directories in a remote machine.

    Hi all,
    Is there any way to create directories in remote machines?
    I'm sending files from a server machine to a client machine.
    Now I'm just sending them in bytes and writing them in the client in a file already created.
    Please help me to dynamically create files and directories in the client machine.
    Thanks in advance.

    hi,
    u can pass the Directories list (or path)and then create them there using mkdir() and mkdirs().
    refer java.io.File in API.
    can u suggest me a way to do this?
    I am working in a project where i need to get files from a folder present in local drives or from a shared folder in some other machine connected in the LAN
    I'm having problem with accessing files in a shared folder i.e., I'm getting Null Pointer Exception.Should the folder be considered as a file in a remotehost and that host be connected with my machine?
    Is there anyway to do this?

  • Ssh login works but main login on remote machine does not

    I have a PPC Mac mini with Tiger installed at a co-locate with a static ip. I also have remote desktop and I recently discovered that although I can successfully log into my remote machine on a terminal using ssh I can't log into the machine using RD. It connects, in other words I see my remote desktop with the choices for logging in. But if I choose my account, which is the only one to choose, and enter my password I get the shakes, the dialog shakes letting me know I did something wrong. I know my password is right because I have it written down and I can log in using ssh. Why would these be different? My apologies if this question is not in the right forum. I wasn't sure where to post this.

    Have you set up the account in the Sharing -> Remote Desktop -> Access Privileges to allow connection and the appropriate functions?

  • Running ldifmigrator/ldapadd from remote machine

    Hi,
    I installed Infra with OID on machine-1. I am now trying to run ldifmigrator on machine-2 while doing a lookup on the oid on the first machine. Is there some problem with this ?
    The command works fine when I run it locally on machine-1. The command is:
    <--------------------------------------------------------
    ldifmigrator "input_file=d:/config/ldap/system-oid.sbs" "output_file=d:/config/ldap/system-oid.ldif" -lookup "host=machine-1" "port=333" "subscriber=idc" "s_UserCommonNamingAttribute=cn" dn="cn=orcladmin" password=welcome1
    -------------------------------------------------------->
    When I run this command on a remote machine say machine-2 then i get the error:
    <----------------------------------------------------
    Unable to establish connection to directory. Please verify the input parameters:
    host, port, dn & password
    returnInitialLdapContext() times out after 10000 ms - JNDI initialization method
    not returning
    ----------------------------------------------------->
    My http port is 777 and oid port is 333. Another strange thing is that I can only access http://machine-1:777/oiddas from machine-1. This is not possible from machine-2 even though ping works fine.. Hoping for some help !
    Thanks !

    It sounds like your firewall could be preventing external connections. How is that configured?

Maybe you are looking for

  • Noutbook problems

    Good Evening! I am here for the first time and do not know who to contact with a problem. I have a laptop HP ProBook4530s series bought two months ago. Appearing problem with the program for recording DVD, first on her sound disappeared then the comp

  • Multiple Video Clips

    Does DVDSP4 support multiple video clips in a track? It allowed me to add a video clip after the first one but the second clip is black when I play it. This is for a dance recital where i want each section title screen to be separate from the video.

  • Screen Sharing in Open Directory

    I have an Xserve running 10.5.8 server, a student lab of 16 iMacs running 10.6, and one teacher station in the lab. I have Apple Remote Desktop running on the Xserve, but the instructor would like to use "screen sharing" to see student computers. We

  • Can not use the maps Otherwise iPad will switch off itself

    As the question described in the topic, I now want to reinstall this app or delete it from the first page, but I can not a way to do that. Could anybody please tell me how to do it-delete the apps from the first page. When I long tap the apps icon in

  • Front Row Scan Speed?

    Hi, When playing back movies or tv shows now, Front row seems to jump too far through the movie. Is there are preference file I can tweak to set this back to the seek speed of Tiger?