Test and Enable CRM Mailbox programmatically - dynamics-crm-online

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.

Related

Force Filewave verification

I'm looking for a way to force a client computer to verify with our MDM filewave server preferably inside a script. Right now the only non gui way I have to force a verify on the client end, is by killing the fwcld service. This works well when ran directly on the client machine, but does not work when ran as a fileset from the filewave server.
The reason I need this, is because Kernel extension policies hang at "Handled via MDM" and will not activate until the next verification. This is way too slow when software is dependent on the kernel extension to install.
If anyone has a solution, either a script, or some other way to make the policy install quicker. I'd really appreciate. I've been banging my head against the wall for too long, the wall is looking pretty rough.
According to FileWave's documentation MDM-managed clients auto-verify with the FileWave server, based on the "tickle interval".
“waits for a specified amount of time (Tickle Interval … ) before it tries to connect again.”
By default this value is set to 120sec. The tickle interval can be changed by using the "SuperPrefs Editor". When using the SuperPrefs Editor only modify the values that you want to change.
Use these instructions to help you upload and apply the new FWpreferences to the (necessary) FileWave clients.
Link to Knowledgebase
**FileWave has moved the Knowledgebase. All links above have been updated. 9/21/22 **

Send an email whenever file is deleted from shared folder in windows 7

I am running a software on several computers at my workplace and the software can run different audio and video files stored on a shared folder in a central computer. The software runs on windows 7 and every person in my company can add or remove files from the shared folder, but this privilege puts the data at risk. I was thinking of creating an email alert to my self whenever a file is deleted. I have written a windows powershell script for sending me emails from smtp server but how can I hook it up to the event of file or folder deletion in a specific shared folder?
Honestly, if you want real time monitoring (I'm guessing you do since you're wanting an email alert sent to you when you detect file deletion), then the hardest part is going to be keeping the script running...
Anyway, the first two things you're going to need to do are
1) Enable the Audit Policy "Audit Object Access" on the server hosting the share
2) Enable auditing for the user/group you're monitoring
After that, you're going to want to use the Get-Eventlog cmdlet to search for event ID 4663 (you can also use event IDs 4656 and 4658 to correlate the event - they represent the opening and closing of a given file).
Anyway, after you've enabled auditing, use something like this get started:
Get-EventLog security | Where-Object {$_.EventID -eq 4663}
Oh, and to keep it running, you'll probably want to use a scheduled job.
Or you could use an IO.FileSystemWatcher object and register an event.
Grts.

how to auto open an entity created in a workflow

I have run into a situation where I need to open a newly created quote at the end of a workflow. I have a feeling this is going to require me to create a a very simple custom workflow that uses "window.open", but I would like to avoid this if anyone has a better idea.
So I need to open a newly created quote as soon as it is created in a workflow. Anyone have any good ideas on how to do this?
Workflows are asynchronous; they run on the server (as opposed to the client) and do not run in realtime. eg a workflow that is triggered by creation of a record will run on the server sometime after the record is created (depending on system load etc - it could be a second or two, or could be half an hour later. If you have stopped the CRM Async service on the server, they might well never run.)
Because they run on the server the user has no interaction with them. As a result you can't open a window, as there's no user involved to open a window for...
What you probably want to do is make use of Dialogs (introduced in CRM 2011). You won't be able to use window.open() but as long as you've got a recent update rollup installed on the server you can present the user with a hyperlink to most CRM records.
Setup of Dialogs is much the same as Workflows, and they use the same mechanics under the hood. The difference is that they're syncronous (i.e. run in real-time) and they are client-side. There's some detail on Technet: http://technet.microsoft.com/en-us/library/gg334463.aspx

How to get notification of workflow errors?

I am having issues were a workflow is stalled because there is an issue with sending an email (send email activity). Typically, this is simply solved by resuming the workflow. I'm wondering if there any way to react to a workflow error, so the user knows they need to go in and resume the workflow.
I'm also wondering about this relative to a workflow that is attempting to assign a task to a user who no longer exists in the CRM or one that has an invalid email address, which I'm assuming would cause errors in workflows as well.
Any other suggestions related to this sort if issue would be welcome.
Thanks!
My point of view, is that monitoring can't be done inside CRM, because all CRM processes could be problematic (what happen if a workflow fails to monitor another workflow?)
The way I already done that, was by adding a SQL query (that check the workflow instance state) to a monitoring tool (such as Nagios with the check_mssql_health) or you can just create a small service that will send emails using SMTP.
Off the top of my head, I can't think of an automated way to do it (you could try attaching a workflow to a workflow instance record, but I'm not sure if that will do it).
I'd probably try to build a utility to query workflow instance records, and then notify users if necessary based on their status.

How to identify users which are connected to a windows server via remote desktop

At my workplace, we have lab machines that we use to do our testing.
The standard procedure to reserve a machine for testing was to walk around the office to make sure that no one was using the machine.
This is highly inefficient and time consuming.
At first, I set up a web page where people could reserve the lab machine but nobody was keeping the page updated so that turned up to be useless.
I finally found a solution using Microsoft log parser and wanted to share it to the stack overflow community.
It is a batch file that runs on the machine so the user can identify the last users that use the machine and easily IM them to ask if the machine is free.
Is there a better solution to do this?
Use the built-in command qwinsta (Query Win Station) to figure out what sessions (including console) are active or inactive (disconnected) and then act on the given information (creds to krusty.ar btw for linking this already).
If you feel people are abusing the machine in question, refer to rwinsta to nuke their sessions into oblivion...
You will need to install the Microsoft Log Parser
Then create the following 2 files
TSLoginsDetails.sql
SELECT
timegenerated,
EXTRACT_TOKEN(Strings,1,'|') AS Domain,
EXTRACT_TOKEN(Strings,0,'|') AS User,
EXTRACT_TOKEN(Strings,3,'|') AS SessionName,
EXTRACT_TOKEN(Strings,4,'|') AS ClientName,
EXTRACT_TOKEN(Strings,5,'|') AS ClientAddress,
EventID
FROM Security
WHERE EventID=682
ORDER BY timegenerated DESC
TSLogins.bat
echo off
cls
c:
cd "c:\Program Files\Log Parser 2.2\"
logparser.exe file:TSLoginsDetails.sql -o:DATAGRID
Now by placing this batch file on the desktop, the user can see who were the last people to login and contact them by IM to verify if they are done.
How about posting the information from the log file to the website that tells who is currently using the machine as well.
Check and notify when they log in.
Updated the "who is using the machine" page you made prior.
Run a AT job that checks every couple of hours who is on it.
Totally out of the box:
You can install the Software Testing Automation Framework (STAF) on your servers and desktops to manage your tests. It's written in Java, so you can use it on Windows and Unix/Linux desktops and servers.
Using STAF, you can create a resource pool of test servers on which you conduct tests, then write STAX jobs (STAX is a STAF execution framework) to conduct the tests. The job can grab the first available server from the resource pool, run the test, monitor the test status, log results, notify the submitter, then release the server back into the pool when done. If you have multiple people submitting jobs for tests, STAF will manage the queue of requests and satisfy them as they came in. Users can either monitor the job from their desktop, or you can set up email alerts to notify them when the test is complete.
I'm not sure if I understand you, but there are a set of command line tools to deal with terminal server sessions, and there's also a Windows API to do the same if you need to do this from a program.
Since it sounds like you're a microsoft shop, you can set up the machines as resources in outlook/exchange and reserve them that way.

Resources