Get Full name from Get-MailBoxPermission
I am trying to build a report with the names of users who have access to shared mailboxes. I have the command running and outputting good information, but it displays a table in the following format:
User
Domain\Username
How can I get output that display's the user's Fullname, first and last?
Here is the code:
$Users = Get-MailboxPermission -identity callcenter | where {$_.user.tostring() -ne "NT AUTHORITY\SELF" -and $_.IsInherited -eq $false} | Select User
$Users | Format-Table
Thank you for any help
How about this?
$users = Get-MailboxPermission -identity callcenter | where {$_.user -notlike "*NT AUTHORITY\SELF" -and $_.IsInherited -eq $false}
$users | select @{Name="User Name";expression={(Get-Recipient $_.user.tostring()).displayname}} | FT
OR
$users | select @{Name="First Name";expression={(Get-Recipient $_.user.tostring()).FirstName}}, @{Name="Last Name";expression={(Get-Recipient $_.user.tostring()).LastName}}
Similar Messages
-
Report that gets full name from the users id in the computer name
I don't even know if this is possible, but I am finding that quite often of late I am needing to get the users full name from the computer name.
We have a standard where a computer name is in this format XXXXXXXUSERID.
Is there a way to get the Full name from the USERID that is in the computername (not last logged on user).
I am fairly sure that I might be able to work it out in SQLSMS but I really need it on the web reports form SCCM.
If anyone has any ideas please let me know.Thanks, I want to add it to most my reports but this is the main one that I am using right now due to an audit.
SELECT DISTINCT
CS.Name0 AS 'Computer Name', CS.Domain0 AS 'Domain', CS.UserName0 AS 'User', BIOS.SerialNumber0 AS 'Bios serial',
SE.SerialNumber0 AS 'System Enclosure serial', CS.Manufacturer0 AS 'Manufacturer', CS.Model0 AS 'model', OS.Caption0 AS 'OS',
RAA.SMS_Assigned_Sites0 AS 'Site', RAM.TotalPhysicalMemory0 AS 'Total Memory', SUM(ISNULL(LDisk.Size0, '0')) AS 'Hardrive Size',
SUM(ISNULL(LDisk.FreeSpace0, '0')) AS 'Free Space', CPU.Name0 AS [CPU Name]
FROM dbo.v_GS_COMPUTER_SYSTEM AS CS RIGHT OUTER JOIN
dbo.v_GS_PC_BIOS AS BIOS ON BIOS.ResourceID = CS.ResourceID RIGHT OUTER JOIN
dbo.v_GS_SYSTEM AS SYS ON SYS.ResourceID = CS.ResourceID RIGHT OUTER JOIN
dbo.v_GS_OPERATING_SYSTEM AS OS ON OS.ResourceID = CS.ResourceID RIGHT OUTER JOIN
dbo.v_RA_System_SMSAssignedSites AS RAA ON RAA.ResourceID = CS.ResourceID RIGHT OUTER JOIN
dbo.v_GS_X86_PC_MEMORY AS RAM ON RAM.ResourceID = CS.ResourceID RIGHT OUTER JOIN
dbo.v_GS_LOGICAL_DISK AS LDisk ON LDisk.ResourceID = CS.ResourceID RIGHT OUTER JOIN
dbo.v_GS_PROCESSOR AS CPU ON CPU.ResourceID = CS.ResourceID RIGHT OUTER JOIN
dbo.v_GS_SYSTEM_ENCLOSURE AS SE ON SE.ResourceID = CS.ResourceID
WHERE (LDisk.DriveType0 = 3)
GROUP BY CS.Name0, CS.Domain0, CS.UserName0, BIOS.SerialNumber0, SE.SerialNumber0, CS.Manufacturer0, CS.Model0, OS.Caption0, RAA.SMS_Assigned_Sites0,
RAM.TotalPhysicalMemory0, CPU.Name0
What I really want to do is add another column called owner that just has the UID in it, I will then try to pull the users full name into another column.. hopefully I am not biting off more then I can chew with this but i have thousands of records and i
will be forced to export to excel or something then look up all the names if I can't do this... -
How do you remove your FULL name from the SYSTEM COMPLETELY?!?!
I have added and removed the user thinking that would remove my full name from the system, but when I click on the "About this Mac" and then click on More info, My FULL NAME is still there as the owner of the computer. I am selling it and I do not want my name on the computer at all and do not wish to format the whole drive to do so. Is there another way of removing it? I appreciate anyone that has the correct answer.
System Preferences>Sharing>Computer Name.
BTW, unless you know and completely trust the person to whom you are selling, this is not the way to do things. Your sensitive data may still be recoverable.
http://hivelogic.com/articles/how-to-prepare-a-mac-for-sale
Choose zero out (one pass is sufficient.) -
How to get the Full Name from NT realm
I need to get the full name of the logged user not just the username. I get
the username defined in NT by request.getRemoteUser(). I need to get the
full name defined in NT server.
Thanks
madhuHi Madhu,
There are no apis to do this with WebLogic.
What I recommend is to do some JNI with Java
Create some custom class which retrieves the nt username and then makes calls to
microsoft libraries to return the full name.
I have no idea what these calls to microsoft libraries will actually be --
you'll probably have to do some research to see how to retrieve full usernames
from NT -- what libraries you need to use, etc.
Good luck.
Joe Jerry
m holur wrote:
I need to get the full name of the logged user not just the username. I get
the username defined in NT by request.getRemoteUser(). I need to get the
full name defined in NT server.
Thanks
madhu -
Leopard. Did a full restore from Time Machine. Now I can't access my other internal and external drives. I get the following error: The folder “Capture Video” can’t be opened because you don’t have permission to see its contents. I have repaired permissions pn the main harddrive. When I try too click on a disk I get the previously stated error. I can't even open up information to see what permission/access there is. It simply will not let me see the content. It shows the content of my main hard drive when I have clicked the other harddrive's name.
Solved:
sudo chflags 0 /Volumes/"FCP Time Machine BU"
sudo chown 0:80 /Volumes/"FCP Time Machine BU"
sudo chmod 775 /Volumes/"FCP Time Machine BU"
sudo chmod -N /Volumes/"FCP Time Machine BU" -
How to get the long file name from an 8.3 name in Windows.
Because of a legacy string limitation, I have a list of files in 8.3 format. The actual files are saved with long names. How can I get the long name from the short name?
In JavaScript, I would get a file system object and get the file object from there with the short name. Then it's no problem to get the full name. But I don't see anything in Java that matches that. ???
Ideas?
Frank Perry, MSEEHere is what I did.
String displayName = "somefi~1.txt";
File fO = new File("c:\\"); // I have a more involved path but that's not important here.
String stPath = fO.getPath() + displayName;
File fD = new File(stPath); // get the file using the short name.
File fDc = new File(fD.getCanonicalPath()); // get another file using the cononical name
String FulldisplayName = fDc.getName(); // get the long name from there.
It's roundabout but it works. Since getName() on the file read with the short name only returns the name used to get the file, I open it twice. The alternative is to parse the cononical name for the file name but that's clumbsy too.
Frank -
How to get the target file name from an URL?
Hi there,
I am trying to download data from an URL and save the content in a file that have the same name as the file on the server. In some way, what I want to do is pretty similar to what you can do when you do a right click on a link in Internet Explorer (or any other web browser) and choose "save target as".
If the URL is a direct link to the file (for example: http://java.sun.com/images/e8_java_logo_red.jpg ), I do not have any problem:
URL url = new URL("http://java.sun.com/images/e8_java_logo_red.jpg");
System.out.println("Opening connection to " + url + "...");
// Copy resource to local file
InputStream is = url.openStream();
FileOutputStream fos=null;
String fileName = null;
StringTokenizer st=new StringTokenizer(url.getFile(), "/");
while (st.hasMoreTokens())
fileName=st.nextToken();
System.out.println("The file name will be: " + fileName);
File localFile= new File(System.getProperty("user.dir"), fileName);
fos = new FileOutputStream(localFile);
try {
byte[] buf = new byte[1024];
int i = 0;
while ((i = is.read(buf)) != -1) {
fos.write(buf, 0, i);
} catch (Throwable e) {
e.printStackTrace();
} finally {
if (is != null)
is.close();
if (fos != null)
fos.close();
}Everything is fine, the file name I get is "e8_java_logo_red.jpg", which is what I expect to get.
However, if the URL is an indirect link to the file (for example: http://javadl.sun.com/webapps/download/AutoDL?BundleId=37719 , which link to a file named JavaSetup6u18-rv.exe ), the similar code return AutoDL?BundleId=37719 as file name, when I would like to have JavaSetup6u18-rv.exe .
URL url = new URL("http://javadl.sun.com/webapps/download/AutoDL?BundleId=37719");
System.out.println("Opening connection to " + url + "...");
// Copy resource to local file
InputStream is = url.openStream();
FileOutputStream fos=null;
String fileName = null;
StringTokenizer st=new StringTokenizer(url.getFile(), "/");
while (st.hasMoreTokens())
fileName=st.nextToken();
System.out.println("The file name will be: " + fileName);
File localFile= new File(System.getProperty("user.dir"), fileName);
fos = new FileOutputStream(localFile);
try {
byte[] buf = new byte[1024];
int i = 0;
while ((i = is.read(buf)) != -1) {
fos.write(buf, 0, i);
} catch (Throwable e) {
e.printStackTrace();
} finally {
if (is != null)
is.close();
if (fos != null)
fos.close();
}Do you know how I can do that.
Thanks for your help
// JB
Edited by: jb-from-sydney on Feb 9, 2010 10:37 PMThanks for your answer.
By following your idea, I found out that one of the header ( content-disposition ) can contain the name to be used if the file is downloaded. Here is the full code that allow you to download locally a file on the Internet:
* Download locally a file from a given URL.
* @param url - the url.
* @param destinationFolder - The destination folder.
* @return the file
* @throws IOException Signals that an I/O exception has occurred.
public static final File downloadFile(URL url, File destinationFolder) throws IOException {
URLConnection urlC = url.openConnection();
InputStream is = urlC.getInputStream();
FileOutputStream fos = null;
String fileName = getFileName(urlC);
destinationFolder.mkdirs();
File localFile = new File(destinationFolder, fileName);
fos = new FileOutputStream(localFile);
try {
byte[] buf = new byte[1024];
int i = 0;
while ((i = is.read(buf)) != -1) {
fos.write(buf, 0, i);
} finally {
if (is != null)
is.close();
if (fos != null)
fos.close();
return localFile;
* Returns the file name associated to an url connection.<br />
* The result is not a path but just a file name.
* @param urlC - the url connection
* @return the file name
* @throws IOException Signals that an I/O exception has occurred.
private static final String getFileName(URLConnection urlC) throws IOException {
String fileName = null;
String contentDisposition = urlC.getHeaderField("content-disposition");
if (contentDisposition != null) {
fileName = extractFileNameFromContentDisposition(contentDisposition);
// if the file name cannot be extracted from the content-disposition
// header, using the url.getFilename() method
if (fileName == null) {
StringTokenizer st = new StringTokenizer(urlC.getURL().getFile(), "/");
while (st.hasMoreTokens())
fileName = st.nextToken();
return fileName;
* Extract the file name from the content disposition header.
* <p>
* See <a
* href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html">http:
* //www.w3.org/Protocols/rfc2616/rfc2616-sec19.html</a> for detailled
* information regarding the headers in HTML.
* @param contentDisposition - the content-disposition header. Cannot be
* <code>null>/code>.
* @return the file name, or <code>null</code> if the content-disposition
* header does not contain the filename attribute.
private static final String extractFileNameFromContentDisposition(
String contentDisposition) {
String[] attributes = contentDisposition.split(";");
for (String a : attributes) {
if (a.toLowerCase().contains("filename")) {
// The attribute is the file name. The filename is between
// quotes.
return a.substring(a.indexOf('\"') + 1, a.lastIndexOf('\"'));
// not found
return null;
} -
How to get the file name from downloads folder with the applescript??
Hi All..
I am downloading an application to downloads folder, I need to install the same application after downloading programatically.
So how do I get the filename in runtime while downloading or after downloading from downloads folder with Applescript or Java?
Also my download URL link doesnot contain full name of the download file.
Pls suggest.Hi,
The best method is to use curl.
Other methods are not reliable, but can work, it depends on several factors (what the script does, what the user does).
Here is an example with the curl command:
set tUrl to "http://sourceforge.net/projects/vlc/files/2.0.4/macosx/vlc-2.0.4.dmg/download?ac cel_key=60%3A1350656196%3Ahttp%253A//www.videolan.org/vlc/download-macosx.html%3 A7233e4e9%245818d66f39b0576e1e9c4a0f3b46b1991180bfdd&click_id=976a88ee-19f7-11e2 -9a21-0200ac1d1d8e&source=accel"
set dFolder to path to downloads folder
tell application "Finder" to set newFolder to (make new folder at dFolder) as string
set f to quoted form of POSIX path of newFolder
do shell script "cd " & f & " && curl -L " & tUrl & " -o 'vlc.dmg'" -- download to file "vlc.dmg"
set downloadedFile to newFolder & "vlc.dmg" --<-- HFS path
--do something with the downloadedFile -
How to get the full name of the Account Owner?
Hi,
I would like to ask if there's a way to display the full name of the Account Owner in a report where the subject area is Opportunity? Currently, the Username (under Owned By User) which displays the full name is equal to the Opportunity Owner.
Thanks,
TeenaHi Cameron,
Thanks again.
Currently, I have a report under Opportunity history where the following fields are being shown:
- Account's Country
- Opportunity Owner (Owned By User - gives me the full name)
- Account Name
- Opportunity Name
- Metrics field (Revenue, Volume. etc.)
- Close Date
- some custom fields
The users want to see the Account Owner so I added this field but it's showing the owner's alias. My question is, in using the "Combine with Similar Analysis", can I display all the values retrieved by the Opportunity report and get the value of 'Owned By User' in the Account report?
I have tried combining the two reports but the values are derived from the driving report which is Opportunity. How can I get the value/format of the field in the Account report?
Teena -
How to get the actual font name from a font file?
Hi
I have only the font Path I have to get the font name from that path. Any idea how to get the actual font name?
Thanks,I would ask you these questions:
Why do you need to do this? What are you ultimately trying to accomplish?
Are you really asking about the InDesign SDK?
Do you really need to get the "name" of a font from an arbitrary file? Or do you want information about a font installed on the system? If so, what OS?
Do you need to be able to handle any font format?
Which font "name" do you mean?
What language do you want the name in?
(1) It's not clear what you're trying to accomplish. A bit more information about your ultimate goal would be helpful.
(2) This question is not at all specific to the InDesign SDK. Are you really trying to do something in the context of an InDesign plug-in? If so, you probably want to look at IID_IFONTFAMILY and the IFontFamily::GetFamilyName function.
(3) If you are asking more generally, Windows and Mac both have system API calls to get this information, although those tend to deal with installed system fonts, not with arbitrary font files per se.
Also, you can parse the name table from a True Type or Open Type font without using any system APIs; as True Type and Open Type are well-documented standards. I would start by reading these:
The Naming Table
Font Names Table
(4) Although there are other standards, such as Type 1 (PostScript) fonts, and True Type Collection files and other formats, especially on Mac.
(5) Also, when you start down this road, you will quickly realize that your seemingly simple question is actually ambiguous, and that the answer is kind of complicated, because a font can have many names (a family name, a full font name, a style name, a PostScript name, etc.).
(6) And not only does a font have multiple names, it can have each of those names in multiple languages and encodings.
Any clarification would make this a better question. -
How to get userID or name from SSO, SSO Token
How can I get the userID or name from the SSO token passed through a weblink/webtab to an external application?
That's Simple...
When you configure weblink or webtab you specify the custom application url along with SSO Token %%%SSO Token%%% similarly you can get User First Name, User Last Name, User Full Name and UserId from the same fashion..
Hope this helps...
Regards,
Deepak H Andeli -
How do I change the 'Full Name' on my iCloud Mail (and on my Apple ID as I think this is where it is getting my Full Name? Thanks
To change it on and iOS device, go to Settings>Mail,Contacts,Calendars...tap your iCloud email account, tap you iCloud account at the top, tap Mail at the bottom, then enter the name you want to use in the Name field at the top.
To change the From name on your Mac Mail, go to icloud.com, sign into your account, open Mail, click the gear shaped icon on the top right and choose Preferences, go to the Accounts tab and enter the name you want to use in the Full Name field and click Done. Then quit Mail on your Mac and re-open it. Your new From name should now appear in the drop-down list when you compose a new email. -
Getting links and its names from a html file
Hi everyone
My problem about the a getting links with name from a html file. For example
İn a web page in this site ?SUN? when use click SUN the browser open http://java.sun.com
İ want both of them, so the links and name. I can succeeded the get link but i don t know how to get the link name.
For example :
<B>setRightComponent(Component)</B>
İn this code segment i want to get B tag. But how i don t know. To get A tag i used this code
List result = new ArrayList();
try {
// Create a reader on the HTML content
URL url = new URI(uriStr).toURL();
URLConnection conn = url.openConnection();
Reader rd = new InputStreamReader(conn.getInputStream());
// Parse the HTML
EditorKit kit = new HTMLEditorKit();
HTMLDocument doc = (HTMLDocument)kit.createDefaultDocument();
kit.read(rd, doc, 0);
// Find all the A elements in the HTML document
HTMLDocument.Iterator it = doc.getIterator(HTML.Tag.A);
while (it.isValid()) {
SimpleAttributeSet s = (SimpleAttributeSet)it.getAttributes();
String link = (String)s.getAttribute(HTML.Attribute.HREF);
if (link != null) {
result.add(link);
it.next();
İ can use B tag but i don t know hot to get its value because it has no prefix such as HREF....
i am sorry if i use a bad explanation style or incorrect word.import java.io.*;
import java.net.*;
import javax.swing.text.*;
import javax.swing.text.html.*;
class GetLinks
public static void main(String[] args)
throws Exception
// Create a reader on the HTML content
Reader reader = getReader( args[0] );
// Parse the HTML
EditorKit kit = new HTMLEditorKit();
HTMLDocument doc = (HTMLDocument)kit.createDefaultDocument();
doc.putProperty("IgnoreCharsetDirective", Boolean.TRUE);
kit.read(reader, doc, 0);
// Find all the A elements in the HTML document
HTMLDocument.Iterator it = doc.getIterator(HTML.Tag.A);
while (it.isValid())
SimpleAttributeSet s = (SimpleAttributeSet)it.getAttributes();
String href = (String)s.getAttribute(HTML.Attribute.HREF);
int start = it.getStartOffset();
int end = it.getEndOffset();
String text = doc.getText(start, end - start);
System.out.println( href + " : " + text );
it.next();
// If 'uri' begins with "http:" treat as a URL,
// otherwise, treat as a local file.
static Reader getReader(String uri)
throws IOException
// Retrieve from Internet.
if (uri.startsWith("http:"))
URLConnection conn = new URL(uri).openConnection();
return new InputStreamReader(conn.getInputStream());
// Retrieve from file.
else
return new FileReader(uri);
} -
How can i get all java class names from a package using reflection?
hi,
can i get all classes name from a package using reflection or any other way?
If possible plz give the code with example.You can't, because the package doesn't have to be on the local machine. It could be ANYWHERE.
For example, via a URLClassLoader (ie from the internet) I could load a class called:
com.paperstack.NobodyExpectsTheSpanishInquisitionI haven't written it yet. But I might tomorrow. How are you going to determine if that class is in the package?
This subject comes up a lot. If you want to do something a bit like what you're asking for (but not quite) there are plenty of threads on the subject. Use google and/or the forum search facility to find them.
But the answer to your question, as you asked it, is "you can't do that". -
How can I get the host name from Email address?
hi
When I using socket to develope an email-sending servlet,I don't know how to get the host name from emial address.can you help me,thanksStripping off the user name will give you the domain of from field in the message. This is not the same as the host. Take a look at:
http://www.stopspam.org/email/headers/headers.html
Theres a pretty good discussion about email headers and how to use the information. You probably want to check the information here against the RFC.
Sean
Maybe you are looking for
-
Eem script monitor routing table - multiple entries into 1 email
I have the following script running to report on routing table changes event manager applet route-table-monitor event routing network 0.0.0.0/0 ge 1 action 0.5 set msg "Route changed: Type: $_routing_type, Network: $_routing_network, Mask/Prefix: $_r
-
Posting to a profit center on a vendor line item
We want to post to a profit center on a vendor line item for incoming Accounts Payable invoices. When we use posting key 31, the profit center field is not displayed at all. Is there a way to open the field to post to it?
-
Batching different messages using Seeburger BIC
Hi Experts I have an interesting requirement. I need to batch different messages e.g. ORDERS, ASN & Controls into a single Interchange. They are all EDIFACT messages and we are using Seeburger & BIC. Any idea on how to do this? regards
-
IOS6 update disabled the option to disable/enable location services
I have updated to iOS6 (from the earlier latest iOS5.x.). I now notice that the option to Disable / Enable Location Sevices (global / application specific) is now not possible post this update to iOS6. Note, I have already tried the "Rest Network Set
-
I'm not sure of the slight question whether it will be more and more people found, but I do think it has obvious difference.