Send HTTP request when a computer is added to Active Directory - directory

I'm going to start working with Active Directory (first time in my life) with python ldap3 library. I've searched the internet for a while but couldn't find any solution for my question. I want to send a request when a computer is added to AD. I've found this event that might solve my problem but I've no idea what is this or how can I use this for my problem.
Thanks for answers.

That is an event in the Windows Security Event Log on the domain controller.
Windows does allow you to trigger a scheduled task on an event. To do what you want to do, you could set up a scheduled task on each domain controller.
In Task Scheduler:
Click "Create Task"
Click the "Triggers" tab, then "New..."
For "Begin the task", select "On an event"
In "Log", select "Security, and for "Event ID" put "4741"
Click "OK"
Then on the "Actions" tab is where you tell it what you want it to do when that event happens. You can run anything you want. You can write a PowerShell script if you want. Just search Google for "run PowerShell script from scheduled task" if that's the way you want to go.

Related

How do I know who changed my Cloud Function

Yesterday, on a beautiful Saturday, I was resting. When suddenly the phone rings and the "system has stopped working".
When I observed the "cloud functions" one of them had an upload that I did not do, probably another member of the team.
After all, I was resting!
Now, my manager wants the deployment history for all functions.
How to know and where to get this information?
Entering the "cloud function" I can even see that there was the deploy, but it does not say "which user did it".
There are audit logs kept for all user actions. You can determine who updated the function by:
Go to Logging > Logs Explorer
In the Query Builder text box, add the following search term:
protoPayload.methodName="google.cloud.functions.v1.CloudFunctionsService.UpdateFunction"
Click the Run Query button and then filter down by the date and time of when it was deployed and you'll see the user's email in the principal_email property.
#Brian's answer is good. But here's another way to check Audit logs and see all operations happening on Cloud Functions:
Go to Navigation Menu > Home > Activity
Go to Filter Categories on the right part of the screen and make sure all Activity types are selected (checking only Data Access and configuration works fine as well).
Click Resource type and uncheck all but don't click OK yet.
Type to filter "Cloud Function" then check it.
Click OK.
In logs for the functions you have the information about deployment it should look something like that:
{"#type":"type.googleapis.com/google.cloud.audit.AuditLog","status":{},"authenticationInfo":{"principalEmail":"EMAIL#gmail.com"},"serviceName":"cloudfunctions.googleapis.com","methodName":"google.cloud.functions.v1.CloudFunctionsService.UpdateFunction","resourceName":"projects/ffunctions-nodejs/locations/us-central1/functions/CRON_1440_OptimisationCall"}
I would start with reviewing this information (it is on the Console -> Project -> Functions -> logs)
Down the rabbit hole, we can go into console.cloud.google.com (Console -> Project -> Functions -> click on the three dots and go "Detailed usage statistics").
not really sure what you can dig in there though
Go to the Logs explorer and paste the below to find the updaed users of the cloud function.
resource.type = "cloud_function"
resource.labels.function_name = "your_cloud_function_name"
protoPayload.methodName="google.cloud.functions.v1.CloudFunctionsService.UpdateFunction"
Hope this helps!!

Using apple script to press the return key when prompted to connect to server

Currently this is my delima. Once in a while a build agent will reboot. It needs to always stay connected to share on one of our servers. The idea was to tell finder to mount the volume, wait 2 seconds, and then press enter...since the user name and pssword are both part of the address when I enter it such as SMB://username:password#Server1/DFS it pops up the pasword dialog fully populated but I can't get applescript to recognize it, then press either connect or the return to say "Yes" login witht hat name and don't prompt me.
it worked fine when connecting at home to a synology device but it's not working when connecting to a server in the office.
tell application "Finder" to mount volume "SMB://username:password#Server1/DFS"
delay 2
tell application "System Events" to keystroke "return" -- key code 36
Any help for this seemingly simple step would be greatly apprecited.
I have looked ove the forums and found variou stratagies but they all relate to an application like Firefox or some other script aware app. I just need it to press enter when the password dialog comes up.
First of all the Finder is not needed to mount a volume, you can delete the tell block.
Secondly, if username and password are passed the volume is supposed to mount without a dialog. Maybe you could find the reason why it doesn't.
Nevertheless the password dialog belongs to the process SecurityAgent, you have to use (ugly) GUI scripting to press the button:
tell application "System Events"
repeat until exists process "SecurityAgent"
delay 0.5
end repeat
tell window 1 of process "SecurityAgent"
click button 2
end tell
end tell
The script waits until the window appeared, this is much more reliable than an hard-coded delay.
Looks like a possible XY Problem as I would expect a solution such as https://apple.stackexchange.com/a/698/204318 to work for you to directly mount the share:
mount -t smbfs //username:password#MACHINENAME/SHARENAME /SomeLocalFolderOfChoice
However, if you are really required to interact with the dialog, and as you asked about it, take a look at this tutorial (written in Python) for scripting up something:
detect missing connection
attempt connection
capture screen periodically
look for dialog box, else loop
error after a few seconds of failure
if dialog is detected, interact with it
input username and password
wait, then press return
check if connection worked after a small delay
success or failure
This type of strategy is very powerful for interacting with all sorts of different dialogs you may encounter and should be possible in AppleScript if you are much more familiar with it (or another scripting language).
If you are open to non-AppleScript solutions, then you might consider Keyboard Maestro, one of the best Mac automation tools available.
You said:
it pops up the pasword dialog fully populated but I can't get
applescript to recognize it, then press either connect or the return
to say "Yes" login witht hat name and don't prompt me.
You could probably do this very easily using Keyboard Maestro. Here's an example of the KM Actions to accomplish this.
If you'd like help with KM, please visit the forum at:
https://forum.keyboardmaestro.com/
I'm a big AppleScript/JXA user, but I often find it easier/quicker to use KM for many automation tasks. Of course, KM Macros can execute AppleScript, JXA, Shell Scripts, and other scripts easily.
You can try a full version of KM for free for 30 days.

Stop Processing Of ASP.Net Web Form on Opening an Exe

In my ASP.net application, i have to open a EXE on click of button. When the EXE is open, User should not be allowed to perform any action on the web form, i.e. the exe should behave like a modal popup. I am using the current code to open and return value from EXE.
Dim p As Process
p = Process.Start("D:\VS2010Projects\SignatureCaptureWindows\bin\Debug\SignatureCaptureWindows.exe")
p.WaitForExit()
If (Not p.ExitCode.Equals(0)) Then
Response.Write("Image Successfully saved in Database with ID = " + p.ExitCode.ToString())
DisplaySavedImage(p.ExitCode)
End If
The Exe is opening fine and returning the correct value. However, the user is able to perform action on the web form when the exe is open...
What will be the best way to handle such a scenario ??
Its impossible to do the way you won it. From the moment the user send a submit, or try to open the page, and on code behind you run this exe, then user is wait for the results - in this time you can not make the user to not do anything else - you can not lock the browser, user can close it, reload it, open again the same page, etc.
What you can do is to lock this process using Mutex and not allow to run again if all ready run it.
Mutex on msdn with example : http://msdn.microsoft.com/en-us/library/system.threading.mutex.aspx

Sending alert to pages in asp.net

I am working on web application , in my project there is some type of testing and task assignment to employees.
Now when an employee complete a task and assigned to a user the user automatically get the message on his page ( there is 3 user accessing application , one is admin , second is tester and third is verifier ...both of them works on different pages , now when admin assign a task the tester automatically get a notification " new message " ( for this i am using master page)..on whatever page the tester is on working... now if the tester is completes it 's task and assign to verifier , verifier must get notification "new message" ... and so on..)
for this a have put a button on master page ..and also i have make a windows service that runs on every minute , now my problem is how i sent the message from windows service to my master page button ( that i change text of button).
Is this idea working ?
Why do you need to window service to run in background? Is there any specific reason to have the windows service for these requirements?
As per your detailed description what I understood is that when the employee completes a task and assigned to a user the user automatically get the message on his page. So when the employee is working and completed means they will click on some button that their work is completed. Then while clicking on the button, you just write the code for sending the mail to the tester. like the same way, when the tester is completed their work and click on the testing completes, send a mail to the reviewer and so on..Then where is the need to have a window service for this to send the mails?
All the requirements can be achieved through the simple send mail code.
Let us know if you need any more help or if you don't understand the exact scenario or if anything is missing in the requirements.
Hope it will be helpful to you.
I don't think it is possible to send from a windows service informations to asp.page. You can create a button that can query a webservice about new tasks (but you are counting on the user to press it).
Another more "friendly" way is to have a timer in javascript that uses ajax requests to get new tasks.

Can't terminate BizTalk instances in isolated adapter

Can anyone explain how I can remove service instances ?
- I've got a few which the BizTalk console shows as "Running"
- they are all in the Isolated Adapter
- tried doing a Stop with Full Stop option ...
- tried the Terminate Instance option ...
- even tried deleting the BizTalk application
But they're still there ??
my bad, the application delete did remove them, must have forgot to refresh
Event log has the errors ...
A request-response for the "HTTP" adapter at receive location "/foanite/BTSHTTPReceive.dll" has timed out before a response could be delivered.
but I still don't understand why the terminate wouldn't work
If you are running an Receive Location in an isolated host you normally need to perform a iisreset to be able to delete them.
If the IISReset does't help (it often doesn't) then use the BizTalk Health Monitor.
Select "Maintenance" from left-and tree view
For Task Type, select "Delete" and "Terminate Single Instance (Hard Termination)"
Paste the instance id taken from the BizTalk admin console
Click "Execute Task"

Resources