My GAM is running, and I can pull users info, but I cant seem to find anywhere how to set the BuildingID value in Locations.
Ive tried below, but says buildingID is wrong.
gam user testguy#thisplace.com update BuildingID 12345
I have tested the following command :
gam update user testguy#thisplace.com location type buildingid:12345 endlocation
With the above command I was able to update the buildingid of one user, you should expect an output similar to :
#gam update user test#domain.com location type buildingid:test123 endlocation
updating user test#domain.com...
You can review the following documentation for more information gamcheatsheet
Related
I have an output like:
PS C:\Users\parul> $test2
id label region type image status ipv4
21648848 ubuntu-us-west us-west g6-standard-1 linode/ubuntu20.04 offline 173.255.216.222
I need to get the id value only. How to i get this in powershell
Please refine your question. If you are really asking for how to use properties a google search would've done the trick in under 1 minute.. To answer your question:
help about_Variables
$test2.id
I accidentally added about 600 contacts to my Mac addressbook from a friend's iPhone I synced to my Mac a couple weeks ago. Unfortunately I dont have a backup of my contacts and now they are all synced with my iPhone and iCloud.
I was able to export all the unwanted contacts as ".vcf" files from my friends phone so I have about 600 files like "John Doe.vcf" and also a plain text list of just the contact names.
Ideally I would like a script that matches the data inside the VCF file to make sure I'm deleteing the right contact.
Idea #2 would be to delete the contacts that matches the name in list, skipping the searches that return two or more results (that way I dont lose my own contacts with same name as my friend's)
I started by attempint to delete a single contact using the following applescript but with no luck. Please help!
set daName to "John Doe"
tell application "Contacts"
repeat with onePerson in people
if (value of name of onePerson) is daName then
delete onePerson
end if
end repeat
end tell
--UPDATE--
Here is the final code I used to perform the task. I added a loop at the top that cycles through the list of names copied in the clipboard. I also added the name of the duplicated contact in the dialog box so I could take note of it.
Tips:
Make a backup of all your contacts before running the script.
If you want to see the number of contacts "magically" decreasing
while running the script, scroll down to the of your contacts in
your address book and you'll see the totla amount of contacts
there.
FINAL CODE
set the clipboard to (the clipboard as text)
set the_strings to the clipboard
repeat with this_string in paragraphs of the_strings
set daName to this_string
DeleteContact(daName)
end repeat
on DeleteContact(theName)
tell application "Contacts"
set myList to every person whose name is theName
set Nb to count of myList
if Nb = 0 then return -- no record found
if Nb > 1 then
display dialog theName & " (too many found: do nothing)"
else
set myperson to item 1 of myList -- only 1 found to be deleted
delete myperson
save
end if
end tell
end DeleteContact
The script bellow contains sub-routine which check name and delete. I added some comments to make it easier to adapt for your need :you can build a loop looking for your card and calling the DeleteContact sub-routine.
set daName to "John Doe"
DeleteContact(daName)
on DeleteContact(theName)
tell application "Contacts"
set myList to every person whose name is theName
set Nb to count of myList
if Nb = 0 then return -- no record found
if Nb > 1 then
display dialog "too many found: do nothing"
else
set myperson to item 1 of myList -- only 1 found to be deleted
delete myperson
save
end if
end tell
end DeleteContact
In case same name exist in multiple contact, I display a dialog, but up to you to decide what to do here.
Gio
This is a script I had and it may address your problem although you never said what the problem was.
tell application "Contacts"
local results,dlist,dloop
set results to {}
set dlist to people whose (first name contains "Oxnard" or (last name is equal to "Abercrombe"))
repeat with dloop in dlist
delete dloop
end repeat
set end of results to "Records deleted :" & count of dlist
save
return results
end tell
Note that the Contacts dictionary does define a name property however it will be based on preference settings.
I have to get two different names pulled from this query, the Account Name and the Opportunity Name. Both are called "Name" under each object.
I am able to use a query to retrieve both of them, but I am unable to decipher between the two in order to actually echo/print or use them.
My Query is:
$query = "SELECT Name,Opportunity.Account.Name from Opportunity ";
$response = $mySforceConnection->query($query);
foreach ($response->records as $record) {
echo $record->Name ."<br/>\n";
//echo $record->Opportunity.Account.Name ."<br/>\n";
echo "<br/>\n"; }
The only Name that is displayed is the opportunity Name (when trying different methods, I know the code above will only echo that)
I have made two seperate queries one from account and one from opportunity to ensure both are infact different things, and they are.
I have attempted to echo two "Name" records, both are just the opportunity name it doesn't recognize the account name.
And obviously what is commented out above as "Opportunity.Account.Name" isn't echoing the result, i am recieving an error instead.
I know using an alias is not supported in salesforce so that obviously didn't and won't work, by that I mean trying to do this:
Select Name as OppName
I am unable to find a different way to echo the records, I have done a lot of googling on the subject. Any help would be appreciated or a point in the right direction.
In my schema there is no Name field in the Opportunity object. There is Account Name and it is a lookup on Account Name in the Account object. You can view the schema builder by going to Setup > Schema Builder (it is under App Setup).
To be honest, I don't know why this worked. I'm new to SOAP and Salesforce, so I was just trying different things to get it working. But if anyone else has this problem, this is how I fixed it.
I displayed the account name by using this to echo it:
echo $record->Account->Name ;
The query is still the same as in the question.
Using Powershell, I need to retrieve an Internet email address from a Lotus Notes names.nsf address book.
Within Notes, I can see the internet email address I want to retrieve. It is on the Basics tab, under the Mail section, in a field called "Internet Address". However, I have not been able to find the view it is under, or a way to query it or derive it. It would also be helpful to filter the email addresses I would like to find by the Company on the "Work/Home" tab in Lotus Notes.
Opening one of the names.nsf files in IE, I see a number of the fields I want, but a formatted internet email address isn't in there. All I see is the Lotus notes style of email address:
firstname lastname/mycompany/abc # abc
(The column name that is in is named $16).
Is there a way to pull the full internet email addresses from a Lotus Notes names.nsf address book? If so, how? If they are in some of the "hidden" views available, how do you query the values in those hidden views?
Thanks!
In many cases, the best view to use for finding Person documents is the hidden view called "$Users". It is indexed by just about every variation of the name that you can think of, so lookups just tend to work. You can find it by opening the Person document from the view and reading the NotesItem named "InternetAddress", or you can read it directly from the view column that is labled "InternetAddress", which I believe is the 17th column.
You can access all of the properties for a given user from the NAB using powershell. You must run the 32 bit version of PS if your Notes client is 32 bit. You will be prompted for your Notes ID password.
$notes=new-object -comobject Lotus.NotesSession;
$notes.Initialize("");
$ndb = $notes.getdatabase("admin","names.nsf");
$nview = $ndb.getview('($Users)');
$searchkey = "Schmoe"; #whatever
$doc =$nview.getdocumentbykey($searchkey,$true);
$mailaddress = $doc.getitemvalue('mailaddress')[0];
$internetaddress = $doc.getitemvalue('internetaddress')[0];
I am trying to update a Quickbase record via my Perl script. I am following the Perl API documentation: http://metacpan.org/pod/HTTP::QuickBase
The method used for editing a record is "EditRecord". As per this method, you cannot edit built-in fields which is true.
and I know that I am not modifying built-in field but an user-created field.
e.g. I want to modify the field called "OS" to "Windows"
So per the Perl modules CPAN documentation mentioned above, I do this:
my %new_record=$qb_obj->GetRecord($database_id, $record_id);
$new_record{"OS"}="Windows";
$qb_obj->EditRecord($database_id, $record_id, %new_record);
But I get following error:
The field named "Date Created" with field id 1 cannot be modified
Which basically means that I ma trying to modify the field "Date Created" with Field ID "1". However, I am not doing that. It might be pulling that parameter some how. THe perl as well as the Quickbase documentation is not helping much.
Here is the Quickbase API documentation: http://www.quickbase.com/api-guide/edit_record.html#Overview
Can someone help me on this.
thanks.
Since you already know the id of the record, you don't need to read the record before modifying it. You should be able to just remove your first line, create the %new_record without reading it from QB, then your 2nd and 3rd lines should work fine.
The alternative is to remove the built-in QB fields from %new_record before doing the EditRecord.