VBScript List all Windows Services by user "Log on As" - windows

I need help, how to create script (VB) listing all Services Windows in the computers in TXT file (Using wmi I think better), but I'd like know how to filter by "Log On As" because all customized Services running specify user.
Thank you for everybody.

You can:
for each item in GetObject("winmgmts:\\.\root\CIMV2").ExecQuery("SELECT * FROM Win32_Service WHERE StartName = 'LocalSystem'",,48)
Wscript.Echo item.Name + "/" + item.StartName
next

Related

getting windows user account (profiles) list

I'm trying to take names of all windows user accounts. my code is working but it prints unnecessary user account also,
here is the code I'm using,
Dim query As New SelectQuery("Win32_UserAccount")
Dim searcher As New ManagementObjectSearcher(query)
For Each envVar As ManagementObject In searcher.[Get]()
Console.WriteLine(envVar("Name"))
Next
Output:
Administrator
DefaultAccount
Guest
Sam
WDAGUtilityAccount
Sam is the only user account I created on this PC. I can assume Administrator and Guest accounts come as default with windows. But DefaultAccount and WDAGUtilityAccount accounts are extremely unnecessary for printing in here. How can I prevent those unnecessary accounts printing from this code
As the Jimi's suggestion, I have updated my code by using Disabled property.
Win32_UserAccount class
Dim query As New SelectQuery("Win32_UserAccount")
Dim searcher As New ManagementObjectSearcher(query)
For Each envVar As ManagementObject In searcher.[Get]()
If Not envVar("Disabled").ToString.ToUpper.Equals("TRUE") Then
Console.WriteLine(envVar("Name"))
End If
Next

AppleScript - How to Access Mail Directory?

I am trying to access folder in my mail using apple script. but did not succeed.
My folder Name is : BLABLABLA , it resides under Apple Mail .
I think that it should be :
set myDir to mailbox "BLABLABLA"
this does not work, any suggestions ?
This will retrieve the account mailbox
tell application "Mail"
set AccountNames to name of accounts
choose from list AccountNames with prompt "Select the email account" ¬
without multiple selections allowed
set AccountName to result as string
set MailboxesListV to mailboxes of account AccountName
end tell
Which is what I think you want. (Notice that the result is a list.)
I hope it helps.

Interacting with USER OU in Powershell

User is not your typical OU in Active Directory and I am trying to interact with it to pull its information down. If I run
get-adorganizationlunit -filter 'name -eq "User"'
I receive no output which I guess I expected, but how can I interact with it? I am writing a script to create OU's from a CSV file and we need sub OUs to be added under User. Any ideas?
This is because Users is not an organizational unit, but rather a container. Try runnning Get-ADObject -Filter {Name -eq 'Users'} to get back the Users object; you'll see that it's ObjectClass is 'container', and not 'Organizational Unit.' You cannot create OU's under containers, such as Users. So you'll need to create these new OU's somewhere else.

Transfer PDF file to ftp server in MS access 2007

I'm attempting to upload a pdf file to an ftp server. I've tried this by accessing the wininet dll but unsuccessfully.
What is the best way to do this in MS Access 2007 VB6? I can call a .net dll, but that is my last resort.
Thank you in advance.
If you mean VB6 then there's a control you can use for FTP functions. Go to Project/Components and add the "Microsoft Internet Transfer Control" to your project. It's fairly easy to use, but something like...
Inet.UserName = "Username"
Inet.Password = "Password"
Inet.Protocol = icFTP
Inet.RemoteHost = "123.123.123.123"
Inet.Execute , "put " & sFileToTransfer & " " & sFilenameOnRemoteHost
While Inet.StillExecuting
DoEvents
Wend
Check Inet.ResponseCode when it finishes
If you mean VBA in Ms/Access then you could write out a small batch file and then shell out to execute it.

How to get the contact online status of Skype friends via Applescript

is there a way to get the online status of each Skype contact via Applescript?
So far I only managed to get the group of online users. However, I need also the corresponding online status.
Thnaks for your help!
Cheers
Julian
set groupType to send command "GET GROUP " & group & " TYPE" script name "getType"
if groupType contains "ONLINE" then
set onlineFriends to send command "GET GROUP " & group & " USERS" script name "getType"
Okay, its quite easy... sometimes it helps to take a break ;-)
tell application "Skype"
set result to send command "GET USER <userName> ONLINESTATUS" script name "getType"
end tell
Cheers
Julian

Resources