Can I determine when a default printer was set on windows - windows

We are trying to trace the time a windows default printer was changed and by who or what.
Any ideas?

I don't think that is tracked anywhere. For past changes, you might be out of luck.
For future changes, you could try setting up security auditing (via regedit: Permissions->Acvanced->Auditing) on HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows and watch for changes to that key in the Security event log. The amount of security event messages may make tracking difficult, though.

Related

Test and Enable CRM Mailbox programmatically

Is there a way to "Test and Enable" CRM Mailbox programmatically either using Powershell or CRM SDK? This is for initial user setup.
I have tried using Microsoft.Xrm.Data.Powershell, it does have Approve-CrmEmailAddress and Set-CrmUserMailbox but there doesn't seem to be a way to Enable Mailbox.
Afr thanks for trying out the Xrm Data Powershell module - I noticed that we haven't added that functionality yet so I'll work to get it checked in for the 2.6 release. As long as your mailbox has something to be enabled for (Incoming/Outgoing/ACT) then you can set the testemailconfigurationscheduled to true and check the result after it runs the test/enable process in the background. There also is a way to postpone/schedule it, but most folks want it run right away when they execute the request. You can also set the orgmarkedasprimaryforexchangesync, this tells the enable process to stamp the users mailbox so any other CRM environments know they no longer can sync with the users mailbox (only one org can sync to a mailbox at any one time).
HTH!
Sean
Afr - have you made any progress or found anything out with this? I am currently looking into the same thing. For some reason the mailboxes for a client of mine are being deactivated and upon reactivate I need to test & enable. But since the mailboxes that are deactivated are random - doing something dynamic in c# is a much better way to go.

Parse.com TimeZone necessary for pushes?

When trying to send a push alert through Parse.com, I came across the following warning:
Installations without a known timezone will not receive this campaign.
So, how do I make sure Parse knows a user's timezones? Is there any specific code, or does it to that without the need for code/by default, and this is a moot question?
Thanks!
This is recorded on a per-Installation basis by the Parse library, and should be automatically updated whenever it is updated by the client.
You can verify that Parse is saving time zones by logging into your account, selecting 'Core' (at top) and 'Installation' (at left). You'll see a list of all current installations - the relevant column is timeZone.
The notice that you see when attempting to send a push is just a general reminder, not an indication that there is necessarily anything wrong on your end.
UPDATE 3/1/2015:
I found a bug in this, BTW, that some people might run into. So I'm posting it here in case it might help somebody.
In the current version of Parse, there is a bug wherein an iOS device with their Date & Time "Set Automatically" setting disabled will (potentially) return a timeZone that Parse won't understand. In such an event, local-time scheduled push notifications will not be sent to a user with that setting turned off.
I verified this, myself, on two devices. With "Set Automatically" turned on the Parse Installation is set to "America/Los Angeles" (which is accurate for me). With it turned off, it sets it to "US/Pacific". This is still accurate, obviously, but for some reason Parse does not like that value.
I imagine there are a non-trivial number of iOS users with that setting disabled, so I hope Parse fixes this.

In Windows, what default event sources are available in the Application Event Log?

Short Version:
Are the event sources "Application" and "Application Error" always included in the Application Event Log? Are they available on new installations of Windows XP, Vista and Windows 7? Would it be really bad to use them instead of creating my own source (an impossibility for me)?
Long Version:
I have a ClickOnce application that is used by users without administrative privileges on their machines.
When I try to write to the Appliction Event Log, I get a security exception. (The Windows event logging infrastructure is trying to create me a new event source, and gets a security violation.)
So I would like to try reusing an existing event source. I have found a only two"generic-sounding" sources in the Application Event Log. Are these always part of a Windows installation, and would make a reasonable choice?
Application
Application Error
I am sure this is frowned upon, as I should distinguish my application using its own event source. But this is for infrequent fatal errors, which should be getting logged elsewhere by my code. I just want a really easy place to find them on a client machine in case it all goes wrong...
When I try to write to the Appliction Event Log, I get a security exception. (The Windows event logging infrastructure is trying to create me a new event source, and gets a security violation.)
I have just answered this here: Using EventLog in ClickOnce application
So I would like to try reusing an existing event source. I have found a only two"generic-sounding" sources in the Application Event Log. Are these always part of a Windows installation, and would make a reasonable choice?
It's really not wise to do this. Existing event sources will be used by either Windows applications, or by third party applications. If any of those are removed, or changed by something like a service pack or patch, your program will crash unless you have implemented exception handling to handle the exception gracefully, but then you wont have any event logging.
Also consider the work you may have to do to port your app to the next version of Windows. I suggest you will be making a rod for your own back.
In the answer I linked to, I suggested the best way to handle the problem, is to install your application using admin privs with the installer creating the source, or by creating a simple app that effectively does the same using the admin role.
The only thing else I can suggest is to always run your application in admin mode.

Windows services and setting them to disable

Is there a way for an application to get notified that a specific service is set to disabled?
I have a NT service and I want to "catch" this event and keep that time for later use.
Any thoughts on how to do this?
Thanks
You ought to be able to do something in WMI to do with that. I think that you can subscribe to the __InstanceModificationEvent notification for the particular instance of Win32_Service that you're interested in.
On the other hand, if someone's going to stop and disable the service, they'll just stop and disable the process monitoring it. So you're not going to win, anyway.
Why don't you just secure the service ACL so that only Administrators can stop and disable it? This is, in fact, the default anyway. And if the user's got admin privileges, you've already lost.
other parts of my client app will poll and call RegNotifyChangeKeyValue to see if the service is disabled, it is I will make note of it...

how can I make a Windows service beep?

I've got a service that acts as a watchdog for several apps/servers. There are no user sessions on this machine. I'd like the watchdog to be capable of beeping on the internal speaker should something go wrong (that'd be my queue to go fix whatever it's complaining about)
when I try the Beep() API on Windows nothing happens - I suspect the problem is that the services session isnt permitted to make noises?
can I make this work? any other ideas for how to make the service alert me?
-CG
Call CreateFile on \device\beep, then send down IOCTL_BEEP_SET (see http://www.koders.com/c/fidFEC3527B9D951559D62722A9C0C603863106CA9B.aspx for details)
It may work if you allow it to interact with the desktop (an option configurable somewhere, I can't remember where).
But personally, I'd have it email me.
Though maybe you could have it use the task scheduling API to schedule a task for yourself, so next time you log on you can see it.
I don't know; you've got a few options. I'd avoid beeping though.
Try sending beep char "\a" to console. Not sure if it will work.
Beeping doesn't seem like a good idea - it might end up driving everyone mad....
I'd also agree about the "interact with desktop" option and you set this in the services parameters see A Windows Service without a template
I'd recommend creating a simple client application that polls that server to query for any problems and returns a set of status messages. Then an appropriate UI would be raised (e.g. balloon on the tray), an email sent, etc. containing any warning or failure messages.
This way you also know that the watchdog itself is running and has network connectivity - if the watchdog dies and/or machine locks up you wouldn't otherwise know.
It also avoids being thrown out of a window when the machine starts beeping continuously just after you go to lunch. [+1 to #mikej] :-)
The poll period should be around half (see Nyquist sampling rate) your minimum required response time.

Resources