EWS - Get Throttling Policy - c#

I need to get the parameter values of Get-ThrottlingPolicy for Exchange 2013. I am looking at getting the values.
Is it possible to get this through EWS API?
I have tried extracting this through powershell from C#. I am not able to find the cmdlet Get-ThrottlingPolicy. What is the solution, what could be wrong. I am new to powershell.
Also can we retrieve the current status - ex current concurrency.

Sadly doesn't look like is possible. The github repo does not appear to contain any reference to throttling.
https://github.com/OfficeDev/ews-managed-api/search?q=throttling

Related

Discord.Net - Check if User has ManageServer permission

Trying to check if a User has the ManageServer Permission. I've already got the DiscordClientId & DiscordGuildId and the below is designed to get the current users permissions and from there I can specify the permission I'm looking for, but I can't figure it out
var user = userClientId;
var server = guildId;
var userServerPermissions = server.GetPermissions(user);
EDIT: I'm using a HttpWebRequest to get the DiscordClientId and GuildId's for the user when they login via Oauth2, then splitting out the various data I need to get the Id's.
I strongly recommend that you look into using a library for doing this. The one I've always used is Discord.NET, the library you mentioned on your question with the discord.net tag. Another C# discord library I'm aware of is DSharpPlus but I've never tried it.
For Discord.NET I suggest using the nightly/preview versions because they incorporate the recent Discord intents change. Use them by adding https://www.myget.org/F/discord-net/api/v3/index.json to your Nuget package sources.
A library handles everything nicely for you, meaning that you never need to directly send requests to or receive requests from Discord. Read the Discord.NET getting started guide here.
Here's code from Discord.NET which will determine if some user in some guild has the ManageServer permission:
public bool HasManageServerPermission(SocketGuildUser user)
{
return user.GuildPermissions.ManageGuild;
}

Access aws IAM Policy JSON file programmatically .Net SDK

I want to access the JSON File programmatically.
In the Management Console, you can find that right here
To be specific, not only do I want to access the managed, but also the custom policies.
Sorry, for not being familiar with the proper terms.
I suggest familiarizing yourself with the AWS SDK for .NET.
You would get a policy object by calling the AmazonIdentityManagementServiceClient.GetPolicy() method. This method requires the policy ARN. Next You would get the policy's versions by calling AmazonIdentityManagementServiceClient.ListPolicyVersions(). Once you have both the policy ARN and the ID of the version you want (you probably just want to pull the ID of the latest version out of the versions list), then you would call AmazonIdentityManagementServiceClient.GetPolicyVersion() to get the actual policy JSON document.
If you don't know the ARN for the policy, or you just want to loop through all policies, you would call the AmazonIdentityManagementServiceClient.ListPolicies() method to get a list of all policies. You mentioned in your question that you want to retrieve both the customer managed and AWS managed policies, which this method does:
"Lists all the managed policies that are available in your AWS
account, including your own customer-defined managed policies and all
AWS managed policies."

Is there a way to fetch all DocumentDb resoruces from Azure?

My goal is to fetch all the resources from the azure to our local database. I've been able to fetch various types of resources (virtual machines, websites, storage accounts etc.) using C# SDK (https://github.com/Azure/azure-sdk-for-net). However, it seems there's no wrapper for DocumentDb resource, what's more, I can't event find an endpoint to query it. Do you know how to fetch all DocumentDb resources ?
Try something like this powershell cmdlet
Find-AzureRmResource -ResourceType "Microsoft.DocumentDB/databaseAccounts"
Unfortunately, this doesn't seem to work exactly as expected, which is kind of weird. If I run this
Find-AzureRmResource -ResourceType "Microsoft.Storage/storageAccounts"
It outputs all the storage accounts. Go figure...
edit:
Yes it is working fine. I was looking in the wrong subscription for docDbs... idiot.
As for doing it with REST, #macpak I haven't done it myself, but I suspect you could do something like:
GET https://management.azure.com/subscriptions/yourSubId/resourceGroups/yourResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts?api-version=2016-03-31
This is how https://resources.azure.com works, check it out. Obviously you parameterise the subId and RGname and build the URI. You would also need to get a bearer token and put it in the authorisation header. Use postman and/or fiddler..

How to count emails sent exchange 2010

I need to be able to access message tracking from Exchange 2010. I would prefer to do this with some sort of api but from the research that I've done I can seem to find anything that hints to the possibility to do this through EWS. The end goal is to count the number of emails sent by account and store the numbers into a seperate business application.
Edit: After looking at the EWS wsdl it looks like there is a FindMessageTrackingReport and GetMessageTrackingReport call. These are not found in EWS Managed API. I'm not sure this is what I'm looking for but I won't know until I get the results back from the API. Is there a way that I can still call this with just a normal web service? Any examples?
Something to the effect of this should work. I didn't have the time to import the proper namespaces, so it may not be perfect.
string querystring = "From:username#example.com Kind:email";
ItemView iv = new ItemView(1000);
FindItemsResults<Item> foundItems = _service.FindItems(WellKnownFolderName.SentItems, querystring, iv);
int count = foundItems.count();
I was able to finally find a solution. It wasn't through EWS but rather a combination of C#, Powershell, and Exchange Management Shell. Here is a link to the EWS Message Tracking Report solution

Unable to get the room list from online exchange using EWS Managed API?

My client has created rooms on online exchange. I can see list of rooms at outlook.office365.com
I am following this url (http://msdn.microsoft.com/EN-US/library/office/dn643730(v=exchg.150).aspx) to get the room list from exchange online, but empty list is being returned.
What am i doing wrong? Can anybody help me out?
Unfortunately the GetRooms and GetRoomLists methods, which at a glance appear to be exactly what you are looking for, actually require that one or more "Room Lists" be created on the Exchange server, with one or more existing rooms added to the relevant "Room Lists". Only once this is done will the methods you refer to actually produce any results.
Unfortunately all my research into this topic has (so far) found that the ONLY way anyone can create a room list is via a PowerShell command on the exchange server. It can't be configured through Office 365 settings or through any hosted exchange provider's interface (such as hosted exchange made available via Parallels systems).
If you do have powershell access, try something like this:
http://technet.microsoft.com/en-us/library/ee633471%28v=exchg.141%29.aspx
They way I did was to name all conference rooms with the prefix Conf. For example, ConfAAA1, ConfBBB2, ConfCCC3, etc. Then to retrieve a list of all rooms:
List<NameResolution> result = ExchangeService.ResolveName("Conf",
ResolveNameSearchLocation.ContactsThenDirectory, true).ToList<NameResolution>();

Categories

Resources